diff --git a/README.md b/README.md index 7143e876f5..5dc1c82b60 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ Believe it or not, https://git-scm.com/ has its own test suite. It uses [Playwri > /external/book/content/book/en/v2/_index.html \ > /external/book/content/book/fr/v2/Démarrage-rapide-À-propos-de-la-gestion-de-version.html \ > /external/book/data/ \ +> /external/docs/content/docs/git.html \ > /external/docs/content/docs/git-add/fr.html \ > /external/docs/content/docs/git-clone.html \ > /external/docs/content/docs/git-commit.html \ diff --git a/tests/git-scm.spec.js b/tests/git-scm.spec.js index ef55128728..a195d17f75 100644 --- a/tests/git-scm.spec.js +++ b/tests/git-scm.spec.js @@ -195,6 +195,33 @@ test('manual pages', async ({ page }) => { await expect(synopsis).not.toHaveText(/git remote renom.* /) }) +test('git manual lists commands', async ({ page }) => { + await page.goto(`${url}docs/git`) + + for (const [section, command] of [ + ['main_porcelain_commands', 'git-add[1]'], + ['ancillary_commands', 'git-config[1]'], + ['ancillary_commands', 'git-annotate[1]'], + ['interacting_with_others', 'git-archimport[1]'], + ['manipulation_commands', 'git-apply[1]'], + ['interrogation_commands', 'git-cat-file[1]'], + ['syncing_repositories', 'git-daemon[1]'], + ['syncing_repositories', 'git-http-fetch[1]'], + ['internal_helper_commands', 'git-check-attr[1]'], + ['guides', 'gitcore-tutorial[7]'], + ['repository_command_and_file_interfaces', 'gitattributes[5]'], + [ + 'file_formats_protocols_and_other_developer_interfaces', + 'gitformat-bundle[5]' + ] + ]) { + const commands = page.locator(`#_${section}`) + .locator('xpath=..').locator('dt') + await expect(commands.getByRole('link', { name: command, exact: true })) + .toBeVisible() + } +}) + test('anchor links in manual pages', async ({ page }) => { // Test that anchor links work without HTML tags const anchor = '#Documentation/git-clone.txt---recurse-submodulesltpathspecgt'