diff --git a/playwright/ci-test/playwright.config.ts b/playwright/ci-test/playwright.config.ts index 58bdc004a..6dfa5f952 100644 --- a/playwright/ci-test/playwright.config.ts +++ b/playwright/ci-test/playwright.config.ts @@ -14,6 +14,10 @@ export default defineConfig({ testDir: "./tests", /* Run tests in files in parallel */ timeout: 30 * 1000, + /* Set expect timeout to 15 seconds*/ + expect: { + timeout: 15 * 1000, + }, fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, diff --git a/playwright/ci-test/tests/01-home-page.spec.ts b/playwright/ci-test/tests/01-home-page.spec.ts index 1fb7cf59f..978ef8221 100644 --- a/playwright/ci-test/tests/01-home-page.spec.ts +++ b/playwright/ci-test/tests/01-home-page.spec.ts @@ -1,112 +1,139 @@ -import { test, expect } from '@playwright/test'; +import { test as base, expect } from "@playwright/test"; +import { Header } from "./fixtures/header"; +import { HomePage } from "./fixtures/home-page"; +import { Footer } from "./fixtures/footer"; -let url = '/'; +type HomePageFixtures = { + header: Header; + homePage: HomePage; + footer: Footer; +}; -test('home page', async ({ page }) => { - await page.goto(url); - await expect(page.getByRole('banner')).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link').first()).toBeVisible(); - await expect(page.getByLabel('main navigation').getByText('Product')).toBeVisible(); - await page.getByLabel('main navigation').getByText('Product').hover(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Overview' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Case studies' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Plugins' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Visual Changelogs' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByText('Community')).toBeVisible(); - await page.getByLabel('main navigation').getByText('Community').hover(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Get involved' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Become a Certified Member' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'QGIS Foundation' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Project Organisation' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Members Blog' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Download' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByText('Resources', { exact: true })).toBeVisible(); - await page.getByLabel('main navigation').getByText('Resources', { exact: true }).hover(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'QGIS Resources' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Installation Guide' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Documentation' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Releases' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Roadmap' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Reports' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Books' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Support' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Blog' })).toBeVisible(); - await expect(page.getByLabel('main navigation').getByRole('link', { name: 'Donate' })).toBeVisible(); - await expect(page.getByPlaceholder('Search')).toBeVisible(); - await expect(page.getByPlaceholder('Search')).toBeEmpty(); - await expect(page.locator('div').filter({ hasText: 'Free and open source Spatial' }).first()).toBeVisible(); - await expect(page.getByText('Free and open source').first()).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Spatial without compromise' })).toBeVisible(); - await expect(page.getByText('Giving the power of spatial')).toBeVisible(); - await expect(page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link')).toBeVisible(); - await expect(page.getByText('Available on Windows, Mac,')).toBeVisible(); - await expect(page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('img')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Create maps' })).toBeVisible(); - await expect(page.getByText('Explore QGIS\'s exceptional')).toBeVisible(); - await expect(page.getByText('Class-leading cartography')).toBeVisible(); - await expect(page.getByText('Experience QGIS\' extensive')).toBeVisible(); - await expect(page.getByText('Professional map production')).toBeVisible(); - await expect(page.getByText('Use the intuitive layout')).toBeVisible(); - await expect(page.getByText('Powerful reporting tools')).toBeVisible(); - await expect(page.getByText('Create atlasses and reports')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Edit layers' })).toBeVisible(); - await expect(page.getByText('Harness the unmatched')).toBeVisible(); - await expect(page.locator('.deco-block-2 > img')).toBeVisible(); - await expect(page.locator('.deco-block-1 > img')).toBeVisible(); - await expect(page.getByText('Exceptional digitizing')).toBeVisible(); - await expect(page.getByText('Craft and edit points, lines')).toBeVisible(); - await expect(page.getByText('Advanced construction tools')).toBeVisible(); - await expect(page.getByText('Build geometries with curves')).toBeVisible(); - await expect(page.getByText('Highly customizable forms')).toBeVisible(); - await expect(page.getByText('Create user-friendly forms')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Process and analyze' })).toBeVisible(); - await expect(page.getByText('Benefit from state-of-the art')).toBeVisible(); - await expect(page.locator('.deco-block-3 > img')).toBeVisible(); - await expect(page.getByText('Comprehensive analysis toolset')).toBeVisible(); - await expect(page.getByText('Uncover insights from your')).toBeVisible(); - await expect(page.getByText('Automated analysis workflows')).toBeVisible(); - await expect(page.getByText('Visually combine analysis')).toBeVisible(); - await expect(page.getByText('Extensible analysis')).toBeVisible(); - await expect(page.getByText('Explore a diverse ecosystem')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Share maps' })).toBeVisible(); - await expect(page.getByText('QGIS provides an equal')).toBeVisible(); - await expect(page.locator('.deco-block-4 > img')).toBeVisible(); - await expect(page.getByText('Industry-leading format')).toBeVisible(); - await expect(page.getByText('Conquer data integration')).toBeVisible(); - await expect(page.getByText('Standards and interoperability')).toBeVisible(); - await expect(page.getByText('Amplify your impact by')).toBeVisible(); - await expect(page.getByText('Publish your work')).toBeVisible(); - await expect(page.getByText('Extend QGIS to the cloud and')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Explore QGIS' })).toBeVisible(); - await page.locator('div').filter({ hasText: 'πŸ‘‹ The power of open source' }).first().click(); - await expect(page.locator('.explore > .columns > div > figure > img')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'πŸ‘‹ The power of open source' })).toBeVisible(); - await expect(page.getByText('Our community development')).toBeVisible(); - await expect(page.getByText('Join our annual international')).toBeVisible(); - await expect(page.getByText('Find local user groups and')).toBeVisible(); - await expect(page.getByText('Learn how people around the')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Get involved' }).first()).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Free and open source' })).toBeVisible(); - await expect(page.getByText('QGIS is a public project')).toBeVisible(); - await expect(page.getByText('For that reason QGIS is Free')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Free download' })).toBeVisible(); - await expect(page.frameLocator('iframe[title="YouTube video player"]').locator('.ytp-cued-thumbnail-overlay-image')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Start using QGIS πŸš€' })).toBeVisible(); - await expect(page.getByText('Quick-start tutorials')).toBeVisible(); - await expect(page.getByText('Live demos')).toBeVisible(); - await expect(page.getByText('Up-to-date documentation')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Go to materials' })).toBeVisible(); - await expect(page.getByRole('heading', { name: 'QGIS supporters' })).toBeVisible(); - await expect(page.locator('div').filter({ hasText: 'Add your logo here?' }).nth(2)).toBeVisible(); - await expect(page.locator('div').filter({ hasText: 'Silver partner' }).nth(2)).toBeVisible(); - await expect(page.locator('.supporters-grid > div:nth-child(3)').first()).toBeVisible(); - await expect(page.locator('.tile > .tile').first()).toBeVisible(); - await expect(page.getByRole('contentinfo')).toBeVisible(); - await expect(page.getByRole('img', { name: 'Logo' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'ο‚‚' })).toBeVisible(); - await expect(page.getByRole('link', { name: '' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'ο…§' })).toBeVisible(); - await expect(page.locator('div:nth-child(2) > div:nth-child(2) > a:nth-child(4)').first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'ο‚’' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'οƒ ' })).toBeVisible(); +const test = base.extend({ + header: async ({ page }, use) => { + const header = new Header(page); + await use(header); + }, + homePage: async ({ page }, use) => { + const homePage = new HomePage(page); + await use(homePage); + }, + footer: async ({ page }, use) => { + const footer = new Footer(page); + await use(footer); + } +}); + +test.describe("Home page", () => { + test.beforeEach(async ({ header, homePage }) => { + // Go to the home url before each test. + await homePage.goto(); + }); + + test("Header", async ({ header }) => { + await expect(header.logoLink).toBeVisible(); + await expect(header.productLink).toBeVisible(); + await header.productLink.hover(); + await expect(header.overviewLink).toBeVisible(); + await expect(header.caseStudiesLink).toBeVisible(); + await expect(header.pluginsLink).toBeVisible(); + await expect(header.visualChangelogLink).toBeVisible(); + await expect(header.communityLink).toBeVisible(); + await header.communityLink.hover(); + await expect(header.getInvolvedLink).toBeVisible(); + await expect(header.certifiedMemberLink).toBeVisible(); + await expect(header.qgisFoundationLink).toBeVisible(); + await expect(header.projectOrganisationLink).toBeVisible(); + await expect(header.membersBlogLink).toBeVisible(); + await expect(header.downloadLink).toBeVisible(); + await expect(header.resourcesLink).toBeVisible(); + await header.resourcesLink.hover(); + await expect(header.qgisResourcesLink).toBeVisible(); + await expect(header.installationGuideLink).toBeVisible(); + await expect(header.documentationLink).toBeVisible(); + await expect(header.releasesLink).toBeVisible(); + await expect(header.roadmapLink).toBeVisible(); + await expect(header.reportsLink).toBeVisible(); + await expect(header.booksLink).toBeVisible(); + await expect(header.supportLink).toBeVisible(); + await expect(header.blogLink).toBeVisible(); + await expect(header.donateLink).toBeVisible(); + await expect(header.searchInput).toBeVisible(); + await expect(header.searchInput).toBeEmpty(); + }); + + test("Content", async ({ homePage }) => { + await expect(homePage.freeOpenSourceSpatialDiv).toBeVisible(); + await expect(homePage.spatialWithoutCompromiseHeading).toBeVisible(); + await expect(homePage.createMapsHeading).toBeVisible(); + await expect(homePage.editLayersHeading).toBeVisible(); + await expect(homePage.processAndAnalyzeHeading).toBeVisible(); + await expect(homePage.shareMapsHeading).toBeVisible(); + await expect(homePage.exploreQGISLink).toBeVisible(); + await expect(homePage.powerOfOpenSourceHeading).toBeVisible(); + await expect(homePage.getInvolvedLink).toBeVisible(); + await expect(homePage.freeAndOpenSourceHeading).toBeVisible(); + await expect(homePage.freeDownloadLink).toBeVisible(); + await expect(homePage.youTubeVideoThumbnailOverlayImage).toBeVisible(); + await expect(homePage.startUsingQGISHeading).toBeVisible(); + await expect(homePage.goToMaterialsLink).toBeVisible(); + await expect(homePage.qgisSupportersHeading).toBeVisible(); + await expect(homePage.addYourLogoHereText).toBeVisible(); + await expect(homePage.silverPartnerText).toBeVisible(); + await expect(homePage.supportersGridDiv).toBeVisible(); + await expect(homePage.createMapsImg).toBeVisible(); + await expect(homePage.editLayersImg).toBeVisible(); + await expect(homePage.processImg).toBeVisible(); + await expect(homePage.shareMapsImg).toBeVisible(); + await expect(homePage.communityImg).toBeVisible(); + await expect(homePage.changeLogVideo).toBeVisible(); + await expect(homePage.otherSupporters).toBeVisible(); + + for (const text of homePage.textList) { + await expect(homePage.pageBody).toContainText(text); + } + }); + + test("Footer", async ({ footer }) => { + await expect(footer.banner).toBeVisible(); + await expect(footer.productList).toBeVisible(); + await expect(footer.communityList).toBeVisible(); + await expect(footer.resourcesList.first()).toBeVisible(); + await expect(footer.fundingList).toBeVisible(); + await expect(footer.downloadLink).toBeVisible(); + await expect(footer.overviewLink).toBeVisible(); + await expect(footer.caseStudiesLink).toBeVisible(); + await expect(footer.pluginsLink).toBeVisible(); + await expect(footer.visualChangelogsLink).toBeVisible(); + await expect(footer.getInvolvedLink).toBeVisible(); + await expect(footer.becomeCertifiedMemberLink).toBeVisible(); + await expect(footer.qgisFoundationLink).toBeVisible(); + await expect(footer.projectOrganisationLink).toBeVisible(); + await expect(footer.localUserGroupsLink).toBeVisible(); + await expect(footer.membersBlogsList).toBeVisible(); + await expect(footer.qgisResourcesLink).toBeVisible(); + await expect(footer.installationGuideLink).toBeVisible(); + await expect(footer.documentationLink).toBeVisible(); + await expect(footer.releasesLink).toBeVisible(); + await expect(footer.roadmapLink).toBeVisible(); + await expect(footer.reportsLink).toBeVisible(); + await expect(footer.booksLink).toBeVisible(); + await expect(footer.supportLink).toBeVisible(); + await expect(footer.blogLink).toBeVisible(); + await expect(footer.donateLink).toBeVisible(); + await expect(footer.membershipList).toBeVisible(); + await expect(footer.diversityStatementLink).toBeVisible(); + await expect(footer.codeOfConductLink).toBeVisible(); + await expect(footer.environmentalPolicyLink).toBeVisible(); + await expect(footer.licenseLink).toBeVisible(); + await expect(footer.visualStyleGuideLink).toBeVisible(); + await expect(footer.goodiesLink).toBeVisible(); + await expect(footer.logoImage).toBeVisible(); + await expect(footer.facebookLink).toBeVisible(); + await expect(footer.twitterLink).toBeVisible(); + await expect(footer.youtubeLink).toBeVisible(); + await expect(footer.mapstodonLink).toBeVisible(); + await expect(footer.ghLink).toBeVisible(); + await expect(footer.mailLink).toBeVisible(); + }); }); diff --git a/playwright/ci-test/tests/02-download-page.spec.ts b/playwright/ci-test/tests/02-download-page.spec.ts index dea5bd15b..5eabe4f31 100644 --- a/playwright/ci-test/tests/02-download-page.spec.ts +++ b/playwright/ci-test/tests/02-download-page.spec.ts @@ -1,44 +1,55 @@ -import { test, expect } from '@playwright/test'; +import { test as base, expect } from "@playwright/test"; +import { Sidebar } from "./fixtures/sidebar"; +import { DownloadPage } from "./fixtures/download-page"; +import { HomePage } from "./fixtures/home-page"; -let url = '/'; +type DownloadPageFixtures = { + homePage: HomePage; + sidebar: Sidebar; + downloadPage: DownloadPage; +}; -test('download page', async ({ page }) => { - await page.goto(url); - await page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link').click(); - await expect(page.getByText('Before download starts ΒΆ QGIS')).toBeVisible(); - // the following options are one-time payments and are hidden by default - await expect(page.getByText('$ 10.00').first()).toBeHidden(); - await expect(page.getByText('$ 20.00').first()).toBeHidden(); - await expect(page.getByText('$ 50.00').first()).toBeHidden(); - await expect(page.getByText('$ 100.00').first()).toBeHidden(); - await expect(page.getByText('$ 250.00').first()).toBeHidden(); - await expect(page.locator('#submit-button')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Other methods, more info' })).toBeVisible(); - await expect(page.locator('#currency')).toBeVisible(); - await expect(page.getByRole('button', { name: 'Skip it and go to download' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Product' })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Product' }).locator('span')).toBeVisible(); - await page.locator('#sidebar div').filter({ hasText: 'Product' }).locator('span').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Overview' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Case studies' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Plugins' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Visual Changelogs' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Community' })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Community' }).locator('span')).toBeVisible(); - await page.locator('#sidebar div').filter({ hasText: 'Community' }).locator('span').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Get involved' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Become a certified member' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'QGIS Foundation' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Project Organisation' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Members Blogs' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Funding' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Download' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Resources', exact: true })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Resources' }).locator('span')).toBeVisible(); - await page.locator('#sidebar div').filter({ hasText: 'Resources' }).locator('span').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'QGIS resources' })).toBeVisible(); - await page.getByRole('button', { name: 'Skip it and go to download' }).click(); - await expect(page.getByRole('heading', { name: 'Download QGIS for your' })).toBeVisible(); - await page.getByRole('heading', { name: 'Other platforms' }).click(); - await expect(page.getByRole('heading', { name: 'Other platforms' })).toBeVisible(); +const test = base.extend({ + homePage: async ({ page }, use) => { + const homePage = new HomePage(page); + await use(homePage); + }, + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + downloadPage: async ({ page }, use) => { + const downloadPage = new DownloadPage(page); + await use(downloadPage); + }, +}); + +test("Download page", async ({ homePage, sidebar, downloadPage }) => { + await homePage.goto(); + await homePage.downloadLink.click(); + await expect(downloadPage.beforeDownloadText).toBeVisible(); + // TODO: Add tests for monthly and one-time tabs + await expect(downloadPage.submitButton).toBeVisible(); + await expect(downloadPage.otherMethodsLink).toBeVisible(); + await expect(downloadPage.currencyInput).toBeVisible(); + await expect(downloadPage.skipDownloadButton).toBeVisible(); + await expect(sidebar.productLink).toBeVisible(); + await expect(sidebar.overviewLink).toBeVisible(); + await expect(sidebar.caseStudiesLink).toBeVisible(); + await expect(sidebar.pluginsLink).toBeVisible(); + await expect(sidebar.visualChangelogsLink).toBeVisible(); + await expect(sidebar.communityLink).toBeVisible(); + await expect(sidebar.getInvolvedLink).toBeVisible(); + await expect(sidebar.becomeCertifiedMemberLink).toBeVisible(); + await expect(sidebar.qgisFoundationLink).toBeVisible(); + await expect(sidebar.projectOrganisationLink).toBeVisible(); + await expect(sidebar.membersBlogsLink).toBeVisible(); + await expect(sidebar.fundingLink).toBeVisible(); + await expect(sidebar.downloadLink).toBeVisible(); + await expect(sidebar.resourcesLink).toBeVisible(); + await expect(sidebar.qgisResourcesLink).toBeVisible(); + await downloadPage.skipDownloadButton.click(); + await expect(downloadPage.beforeDownloadHeading).toBeVisible(); + await downloadPage.otherPlatformsHeading.click(); + await expect(downloadPage.otherPlatformsHeading).toBeVisible(); }); diff --git a/playwright/ci-test/tests/03-product-page.spec.ts b/playwright/ci-test/tests/03-product-page.spec.ts index 6b8584abc..628c7ea2f 100644 --- a/playwright/ci-test/tests/03-product-page.spec.ts +++ b/playwright/ci-test/tests/03-product-page.spec.ts @@ -1,53 +1,72 @@ -import { test, expect } from '@playwright/test'; - -let url = '/'; - -test('product page', async ({ page }) => { - await page.goto(url); - await page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link').click(); - await page.locator('#sidebar').getByRole('link', { name: 'Product' }).click(); - await expect(page.getByText('Free and open source')).toBeVisible(); - await expect(page.getByRole('heading', { name: 'QGIS overview' })).toBeVisible(); - await expect(page.getByText('Giving the power of spatial')).toBeVisible(); - await expect(page.locator('section').filter({ hasText: 'Free and open source QGIS' }).getByRole('link')).toBeVisible(); - await expect(page.getByText('Available on Windows, Mac,')).toBeVisible(); - await expect(page.getByText('Key features ΒΆ Create map')).toBeVisible(); - await expect(page.getByText('Create map')).toBeVisible(); - await expect(page.getByText('Edit layers')).toBeVisible(); - await expect(page.getByText('Process and analyze')).toBeVisible(); - await expect(page.getByText('Share maps')).toBeVisible(); - await expect(page.locator('#content-tab-1').getByRole('img', { name: 'Create map' })).toBeVisible(); - await expect(page.getByText('Class-leading cartography ΒΆ Experience QGIS’ extensive set of design options to')).toBeVisible(); - await expect(page.getByRole('img', { name: 'Create map' }).nth(1)).toBeVisible(); - await expect(page.getByText('Enhance the functionality of')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Go to plugins' })).toBeVisible(); - await expect(page.getByRole('img', { name: 'International conference' })).toBeVisible(); - await expect(page.getByText('Connect with professionals,')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Community meetings' })).toBeVisible(); - await expect(page.getByRole('img', { name: 'Local user groups' })).toBeVisible(); - await expect(page.getByRole('heading', { name: 'Local user groups and support' })).toBeVisible(); - await expect(page.getByText('Join a community of like-')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Local groups list' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Join the community' })).toBeVisible(); - await expect(page.getByText('QGIS Server ΒΆ Publish your')).toBeVisible(); - await expect(page.getByText('QGIS Desktop ΒΆ Create, edit,')).toBeVisible(); - await expect(page.getByText('QGIS Web Client ΒΆ Publish')).toBeVisible(); - await expect(page.getByText('QGIS on mobiles and tablets ΒΆ The QGIS experience does not stop on the desktop')).toBeVisible(); - await expect(page.getByText('Case Studies ΒΆ We gather')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Amurum forest reserve habitat' })).toBeVisible(); - await expect(page.getByText('Maps showcase ΒΆ QGIS users')).toBeVisible(); - await expect(page.getByText('Application screenshots ΒΆ Below are some screenshots from QGIS itself and a')).toBeVisible(); - await page.getByRole('link', { name: 'Maps', exact: true }).click(); - await expect(page.getByText('QGIS Maps ΒΆ Amazing maps')).toBeVisible(); - await expect(page.getByText('Amazing maps created using')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Screenshots' })).toBeVisible(); - await page.getByRole('link', { name: 'Screenshots' }).click(); - await expect(page.getByText('QGIS Screenshots ΒΆ Screenshots of QGIS in action')).toBeVisible(); - await expect(page.getByText('Screenshots of QGIS in action')).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Case studies' }).click(); - await expect(page.getByText('Case Studies ΒΆ Amurum forest')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Amurum forest reserve habitat' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Plugins' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Visual Changelogs' }).click(); - await expect(page.getByText('Visual Changelogs ΒΆ Below you')).toBeVisible(); -}); \ No newline at end of file +import { test as base, expect } from "@playwright/test"; +import { HomePage } from "./fixtures/home-page"; +import { Sidebar } from "./fixtures/sidebar"; +import { ProductPage } from "./fixtures/product-page"; + +type ProductPageFixtures = { + homePage: HomePage; + sidebar: Sidebar; + productPage: ProductPage; +}; + +const test = base.extend({ + homePage: async ({ page }, use) => { + const homePage = new HomePage(page); + await use(homePage); + }, + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + productPage: async ({ page }, use) => { + const productPage = new ProductPage(page); + await use(productPage); + }, +}); + +test("Product page", async ({ homePage, sidebar, productPage }) => { + await homePage.goto(); + await homePage.downloadLink.click(); + await sidebar.productLink.click(); + await expect(productPage.fosQGISLink).toBeVisible(); + await expect(productPage.qgisOverview).toBeVisible(); + await expect(productPage.contentTab1Img).toBeVisible(); + await expect(productPage.createMapImg).toBeVisible(); + await expect(productPage.goToPluginsLink).toBeVisible(); + await expect(productPage.internationalConferenceImg).toBeVisible(); + await expect(productPage.communityMeetingsLink).toBeVisible(); + await expect(productPage.localUserGroupsImg).toBeVisible(); + await expect(productPage.localUserGroupsHeading).toBeVisible(); + await expect(productPage.localGroupsListLink).toBeVisible(); + await expect(productPage.joinTheCommunityLink).toBeVisible(); + await expect(productPage.amurumForestLink).toBeVisible(); + + for (const text of productPage.productTextList) { + await expect(productPage.pageBody).toContainText(text); + } + + await productPage.mapsLink.click(); + for (const text of productPage.mapsTextList) { + await expect(productPage.pageBody).toContainText(text); + } + + await expect(productPage.screenshotsLink).toBeVisible(); + await productPage.screenshotsLink.click(); + + for (const text of productPage.screenshotsTextList) { + await expect(productPage.pageBody).toContainText(text); + } + await sidebar.caseStudiesLink.click(); + + for (const text of productPage.caseStudiesTextList) { + await expect(productPage.pageBody).toContainText(text); + } + + await expect(productPage.amurumForestLink).toBeVisible(); + await expect(sidebar.pluginsLink).toBeVisible(); + await sidebar.visualChangelogsLink.click(); + + for (const text of productPage.visualChangelogsTextList) { + await expect(productPage.pageBody).toContainText(text); + } +}); diff --git a/playwright/ci-test/tests/04-community-page.spec.ts b/playwright/ci-test/tests/04-community-page.spec.ts index 046c6d78e..47f894623 100644 --- a/playwright/ci-test/tests/04-community-page.spec.ts +++ b/playwright/ci-test/tests/04-community-page.spec.ts @@ -1,155 +1,241 @@ -import { test, expect } from '@playwright/test'; - -let url = '/'; - -test('community page', async ({ page }) => { - await page.goto(url); - await page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Community' })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Community' }).locator('span')).toBeVisible(); - await page.locator('#sidebar div').filter({ hasText: 'Community' }).locator('span').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Get involved' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Get involved' }).click(); - await expect(page.getByText('Ways of Contributing ΒΆ Participate in Support Channels Report Bugs QGIS')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Participate in Support' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Report Bugs' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Documentation' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Translate QGIS', exact: true })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Develop a Plugin' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Develop QGIS Core' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Sustain & Donate' })).toBeVisible(); - await expect(page.getByText('Participate in Support Channels ΒΆ User groups πŸ‡©πŸ‡ͺ πŸ‡«πŸ‡· πŸ‡ͺπŸ‡Έ')).toBeVisible(); - await expect(page.getByText('Report Bugs ΒΆ If you')).toBeVisible(); - await expect(page.getByText('QGIS Documentation ΒΆ Creating')).toBeVisible(); - await expect(page.getByText('Translate QGIS ΒΆ If you’re')).toBeVisible(); - await expect(page.getByText('Develop a Plugin ΒΆ Interested')).toBeVisible(); - await expect(page.getByText('Develop QGIS Core ΒΆ QGIS Core')).toBeVisible(); - await expect(page.getByText('Sustain & Donate ΒΆ We welcome')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Become a Sustaining Member' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'One-Time Donation' })).toBeVisible(); - // the following options are one-time payments and are hidden by default - await expect(page.getByText('$ 10.00').first()).toBeHidden(); - await expect(page.getByText('$ 20.00').first()).toBeHidden(); - await expect(page.getByText('$ 50.00').first()).toBeHidden(); - await expect(page.getByText('$ 100.00').first()).toBeHidden(); - await expect(page.getByText('$ 250.00').first()).toBeHidden(); - await expect(page.locator('#submit-button')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Other methods, more info' })).toBeVisible(); - await expect(page.locator('#currency')).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Become a certified member' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Become a certified member' }).click(); - await expect(page.getByText('Become a certified member ΒΆ The QGIS Certificate Program is designed to promote')).toBeVisible(); - await expect(page.getByText('The QGIS Certificate Program')).toBeVisible(); - await expect(page.getByText('Development/commits to QGIS Contributions to the QGIS documentation and')).toBeVisible(); - await expect(page.getByText('To contact the certification')).toBeVisible(); - await expect(page.getByText('You are required to provide')).toBeVisible(); - await expect(page.getByText('Following an initial review,')).toBeVisible(); - await expect(page.getByText('The PSC will make the final')).toBeVisible(); - await expect(page.getByText('If approved you are required')).toBeVisible(); - await expect(page.getByText('You can apply through this')).toBeVisible(); - await expect(page.getByRole('img', { name: 'Workflow Certification' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'QGIS Foundation' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'QGIS Foundation' }).click(); - await expect(page.getByRole('link', { name: 'Charter' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Annual General Meetings' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Annual Reports' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Finance' })).toBeVisible(); - await expect(page.getByText('QGIS Foundation Giving the')).toBeVisible(); - await expect(page.getByText('Giving the power of spatial')).toBeVisible(); - await expect(page.getByText('Annual General Meetings Starting in 2016 (coincident with the establishment of')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).first()).toBeVisible(); - await expect(page.getByText('Annual Reports Starting in')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).nth(1)).toBeVisible(); - await expect(page.getByText('Finance Please check the')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).nth(2)).toBeVisible(); - await expect(page.getByText('QGIS.org Charter QGIS.ORG is')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).nth(3)).toBeVisible(); - await page.getByRole('link', { name: 'Charter' }).click(); - await expect(page.getByText('Charter of the QGIS.ORG Association ΒΆ Legal status of QGIS.ORG ΒΆ QGIS.ORG is')).toBeVisible(); - await page.getByRole('link', { name: 'Annual General Meetings' }).click(); - await expect(page.getByText('Annual General Meetings ΒΆ Starting in 2016 (coincident with the establishment')).toBeVisible(); - await page.getByRole('link', { name: 'Annual Reports' }).click(); - await expect(page.getByText('Annual Reports ΒΆ Starting in')).toBeVisible(); - await page.getByRole('link', { name: 'Finance' }).click(); - await expect(page.getByText('Finance ΒΆ Please check the')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Budget 2023 Download PDF' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Project Organisation' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Project Organisation' }).click(); - await expect(page.getByText('Who’s Who ΒΆ QGIS as a Project')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Infrastructure' })).toBeVisible(); - await page.getByRole('link', { name: 'Infrastructure' }).click(); - await expect(page.getByText('Infrastructure ΒΆ This page')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Brand Guidelines' })).toBeVisible(); - await page.getByRole('link', { name: 'Brand Guidelines' }).click(); - await expect(page.getByText('QGIS Trademark and brand guidelines ΒΆ We’re thrilled that you want to refer to')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Contributor Credits' })).toBeVisible(); - await page.getByRole('link', { name: 'Contributor Credits' }).click(); - await expect(page.getByText('Contributor Credits ΒΆ Individuals, institutions and firms who contributed code')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Committee Resolutions' })).toBeVisible(); - await page.getByRole('link', { name: 'Committee Resolutions' }).click(); - await expect(page.getByText('Committee Resolutions Committee Resolution 2019 In 2019, the Project Steering')).toBeVisible(); - await expect(page.getByText('Committee Resolution 2019 In')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).first()).toBeVisible(); - await expect(page.getByText('Committee Resolution 2020 In')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Read more' }).nth(1)).toBeVisible(); - await expect(page.getByRole('link', { name: 'Meetings', exact: true })).toBeVisible(); - await page.getByRole('link', { name: 'Meetings', exact: true }).click(); - await expect(page.getByText('Meetings ΒΆ Since 2009 the')).toBeVisible(); - await expect(page.getByText('Developer Meetings ΒΆ Go to')).toBeVisible(); - await expect(page.getByText('Users Meetings ΒΆ Go to')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Go to meetings' }).first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'Go to meetings' }).nth(1)).toBeVisible(); - await expect(page.getByRole('link', { name: 'Mailing Lists' })).toBeVisible(); - await page.getByRole('link', { name: 'Mailing Lists' }).click(); - await expect(page.getByText('Mailing Lists ΒΆ We')).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Users list http://lists.' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Developers list http://' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Community team http://' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Translations http://' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Project Steering' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Web Client 2 http://' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Funding' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Funding' }).click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Membership' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Membership' }).click(); - await expect(page.getByText('How become a sustaining member')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Become a Sustaining Member' })).toBeVisible(); - await expect(page.locator('div').filter({ hasText: 'Sustaining Membership program Join our mission to enhance and promote QGIS as' }).nth(1)).toBeVisible(); - await expect(page.locator('section').filter({ hasText: 'Sustaining Membership program Join our mission to enhance and promote QGIS as' }).getByRole('link')).toBeVisible(); - await expect(page.getByText('Sustaining Membership program ΒΆ QGIS is an entirely Open Source project. QGIS')).toBeVisible(); - await expect(page.getByText('QGIS is an entirely Open')).toBeVisible(); - await expect(page.getByText('As a result, you have free')).toBeVisible(); - await expect(page.getByText('€ 27,000+ ΒΆ Flagship Member (')).toBeVisible(); - await expect(page.getByText('€ 9,000+ ΒΆ Large Member (e.g')).toBeVisible(); - await expect(page.getByText('€ 3,000+ ΒΆ Medium Member (e.g')).toBeVisible(); - await expect(page.getByText('€ 500+ ΒΆ Small Member (e.g.')).toBeVisible(); - await expect(page.getByText('Public Acknowledgment ΒΆ All')).toBeVisible(); - await expect(page.getByText('Enhanced Software Quality ΒΆ Your contribution aids in resolving bugs and issues')).toBeVisible(); - await expect(page.getByText('Enhanced Brand Exposure ΒΆ Flagship, large and medium sustaining members will')).toBeVisible(); - await expect(page.getByText('Featured in Software Updates ΒΆ Your support is highlighted in the visual')).toBeVisible(); - await expect(page.getByText('Public Acknowledgment ΒΆ Use a')).toBeVisible(); - await expect(page.getByText('Enhanced Brand Exposure ΒΆ Enjoy an ad-free experience in QGIS, focusing on your')).toBeVisible(); - await expect(page.getByText('Reach out to the treasurer at')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Write to trearurer' })).toBeVisible(); - await expect(page.getByText('The treasurer will gather')).toBeVisible(); - await expect(page.getByText('The treasurer verifies the')).toBeVisible(); - await expect(page.getByText('Membership details are')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Open Sustaining Members' })).toBeVisible(); - await expect(page.getByText('Recognition: Sustaining')).toBeVisible(); - await expect(page.getByText('Visibility: Members are')).toBeVisible(); - await expect(page.getByText('Promotion: When appropriate,')).toBeVisible(); - await expect(page.getByText('Past sustaining members are')).toBeVisible(); - await expect(page.getByText('You can also make one-time payement ΒΆ Donations can be of any amount, via')).toBeVisible(); - await expect(page.getByText('About β€˜earmarked’ funding ΒΆ We regret that we cannot accept β€˜earmarked’ funding')).toBeVisible(); - await expect(page.getByText('Warning ΒΆ Acceptance of')).toBeVisible(); - // TODO: why Members are not visible? - // await expect(page.locator('#sidebar').getByRole('link', { name: 'Members' })).toBeVisible(); - // await page.locator('#sidebar').getByRole('link', { name: 'Members' }).click(); - // await expect(page.getByRole('heading', { name: 'Flagship' })).toBeVisible(); - // await expect(page.locator('article').filter({ hasText: 'Felt 2023-01-01 - 2024-02-' })).toBeVisible(); - // await expect(page.getByRole('heading', { name: 'Large' })).toBeVisible(); - // await expect(page.locator('article').filter({ hasText: 'Land Vorarlberg 2023-03-01 -' })).toBeVisible(); - // await expect(page.locator('#sidebar').getByRole('link', { name: 'Past Members' })).toBeVisible(); - // await page.locator('#sidebar').getByRole('link', { name: 'Past Members' }).click(); - // await expect(page.getByText('Past sustaining members ΒΆ Cheslatta Carrier nation 2021-11-19 - 2023-01-31')).toBeVisible(); +import { test as base, expect } from "@playwright/test"; +import { CommunityPage } from "./fixtures/community-page"; +import { HomePage } from "./fixtures/home-page"; +import { Sidebar } from "./fixtures/sidebar"; + +type CommunityPageFixtures = { + homePage: HomePage; + sidebar: Sidebar; + communityPage: CommunityPage; +}; + +const test = base.extend({ + homePage: async ({ page }, use) => { + const homePage = new HomePage(page); + await use(homePage); + }, + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + communityPage: async ({ page }, use) => { + const communityPage = new CommunityPage(page); + await use(communityPage); + }, +}); + +test.describe("Community pages", () => { + test.beforeEach(async ({ communityPage }) => { + // Go to the resources url before each test. + await communityPage.goto(); + }); + test("Get involved", async ({ homePage, sidebar, communityPage }) => { + await expect(sidebar.getInvolvedLink).toBeVisible(); + await sidebar.getInvolvedLink.click(); + + let getInvolvedTexts = communityPage.textList.find( + (item) => item.page == "Get involved", + )?.texts; + + if (getInvolvedTexts) { + for (const item of getInvolvedTexts) { + await expect(communityPage.pageBody).toContainText(item); + } + } + await expect(communityPage.participateSupportLink).toBeVisible(); + await expect(communityPage.reportBugsLink).toBeVisible(); + await expect(communityPage.qgisDocumentationLink).toBeVisible(); + await expect(communityPage.translateQGISLink).toBeVisible(); + await expect(communityPage.developPluginLink).toBeVisible(); + await expect(communityPage.developQGISCoreLink).toBeVisible(); + await expect(communityPage.sustainDonateLink).toBeVisible(); + + // TODO: Add tests for monthly and one-time tabs + + await expect(communityPage.otherMethodsInfoLink).toBeVisible(); + await expect(communityPage.currencyInput).toBeVisible(); + }); + + test("Become a certified member", async ({ sidebar, communityPage }) => { + await expect(sidebar.becomeCertifiedMemberLink).toBeVisible(); + await sidebar.becomeCertifiedMemberLink.click(); + let becomeCertifiedTexts = communityPage.textList.find( + (item) => item.page == "Become a certified member", + )?.texts; + + if (becomeCertifiedTexts) { + for (const item of becomeCertifiedTexts) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.workflowCertificationImg).toBeVisible(); + }); + test("QGIS Foundation", async ({ sidebar, communityPage }) => { + await expect(sidebar.qgisFoundationLink).toBeVisible(); + await sidebar.qgisFoundationLink.click(); + + let qgisFoundationText = communityPage.textList.find( + (item) => item.page == "QGIS Foundation", + )?.texts; + + if (qgisFoundationText) { + for (const item of qgisFoundationText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.charterLink).toBeVisible(); + await expect(communityPage.annualGeneralMeetingsLink).toBeVisible(); + await expect(communityPage.annualReportsLink).toBeVisible(); + await expect(communityPage.financeLink).toBeVisible(); + + await communityPage.charterLink.click(); + + let charterText = communityPage.textList.find( + (item) => item.page == "Charter", + )?.texts; + + if (charterText) { + for (const item of charterText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await communityPage.annualGeneralMeetingsLink.click(); + + let annualGeneralMeetingsText = communityPage.textList.find( + (item) => item.page == "Annual General Meetings", + )?.texts; + + if (annualGeneralMeetingsText) { + for (const item of annualGeneralMeetingsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await communityPage.annualReportsLink.click(); + let annualReportsText = communityPage.textList.find( + (item) => item.page == "Annual Reports", + )?.texts; + + if (annualReportsText) { + for (const item of annualReportsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await communityPage.financeLink.click(); + let financeText = communityPage.textList.find( + (item) => item.page == "Finance", + )?.texts; + + if (financeText) { + for (const item of financeText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + }); + + test("Project Organisation", async ({ sidebar, communityPage }) => { + await expect(sidebar.projectOrganisationLink).toBeVisible(); + await sidebar.projectOrganisationLink.click(); + let projectOrganisationText = communityPage.textList.find( + (item) => item.page == "Project Organisation", + )?.texts; + + if (projectOrganisationText) { + for (const item of projectOrganisationText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.infrastructureLink).toBeVisible(); + await communityPage.infrastructureLink.click(); + let infrastructureText = communityPage.textList.find( + (item) => item.page == "Infrastructure", + )?.texts; + + if (infrastructureText) { + for (const item of infrastructureText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.brandGuidelinesLink).toBeVisible(); + await communityPage.brandGuidelinesLink.click(); + let brandGuidelinesText = communityPage.textList.find( + (item) => item.page == "Brand Guidelines", + )?.texts; + + if (brandGuidelinesText) { + for (const item of brandGuidelinesText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.contributorCreditsLink).toBeVisible(); + await communityPage.contributorCreditsLink.click(); + let contributorCreditsText = communityPage.textList.find( + (item) => item.page == "Contributor Credits", + )?.texts; + + if (contributorCreditsText) { + for (const item of contributorCreditsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.committeeResolutionsLink).toBeVisible(); + await communityPage.committeeResolutionsLink.click(); + + let committeeResolutionsText = communityPage.textList.find( + (item) => item.page == "Committee Resolutions", + )?.texts; + + if (committeeResolutionsText) { + for (const item of committeeResolutionsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.meetingsLink).toBeVisible(); + await communityPage.meetingsLink.click(); + + let meetingsText = communityPage.textList.find( + (item) => item.page == "Meetings", + )?.texts; + + if (meetingsText) { + for (const item of meetingsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.goToMeetingsFirstLink).toBeVisible(); + await expect(communityPage.goToMeetingsNthLink).toBeVisible(); + + await expect(communityPage.mailingListsLink).toBeVisible(); + await communityPage.mailingListsLink.click(); + + let mailingListsText = communityPage.textList.find( + (item) => item.page == "Mailing Lists", + )?.texts; + + if (mailingListsText) { + for (const item of mailingListsText) { + await expect(communityPage.pageBody).toContainText(item); + } + } + + await expect(communityPage.qgisUsersListLink).toBeVisible(); + await expect(communityPage.qgisDevelopersListLink).toBeVisible(); + await expect(communityPage.qgisCommunityTeamLink).toBeVisible(); + await expect(communityPage.qgisTranslationsLink).toBeVisible(); + await expect(communityPage.qgisProjectSteeringLink).toBeVisible(); + await expect(communityPage.qgisWebClientLink).toBeVisible(); + }); }); + +// TODO: why Members are not visible? +// Members has been moved to Funding > Membership diff --git a/playwright/ci-test/tests/05-donate-page.spec.ts b/playwright/ci-test/tests/05-donate-page.spec.ts deleted file mode 100644 index 601ad2394..000000000 --- a/playwright/ci-test/tests/05-donate-page.spec.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { test, expect } from '@playwright/test'; - -let url = '/'; - -test('donate page', async ({ page }) => { - await page.goto(url); - await page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Funding' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Funding' }).click(); - await expect(page.getByText('QGIS is developed by a team')).toBeVisible(); - await expect(page.getByText('We rely on sponsorships and')).toBeVisible(); - await expect(page.getByText('Donations to QGIS are tax-')).toBeVisible(); - await expect(page.getByText('We use the stripe')).toBeVisible(); - // the following options are one-time payments and are hidden by default - await expect(page.getByText('$ 10.00').first()).toBeHidden(); - await expect(page.getByText('$ 20.00').first()).toBeHidden(); - await expect(page.getByText('$ 50.00').first()).toBeHidden(); - await expect(page.getByText('$ 100.00').first()).toBeHidden(); - await expect(page.getByText('$ 250.00').first()).toBeHidden(); - await expect(page.locator('#submit-button')).toBeVisible(); - await expect(page.locator('#currency')).toBeVisible(); - await expect(page.getByText('Bank transfer ΒΆ Use the')).toBeVisible(); - await expect(page.getByText('Account name: QGIS.ORG')).toBeVisible(); - await expect(page.getByText('You can use Paypal')).toBeVisible(); - await expect(page.getByRole('button', { name: 'Donate' })).toBeVisible(); -}); diff --git a/playwright/ci-test/tests/05-funding-page.spec.ts b/playwright/ci-test/tests/05-funding-page.spec.ts new file mode 100644 index 000000000..5b3862b83 --- /dev/null +++ b/playwright/ci-test/tests/05-funding-page.spec.ts @@ -0,0 +1,105 @@ +import { test as base, expect } from "@playwright/test"; +import { + FundingPage, + MembersPage, + PastMembersPage, +} from "./fixtures/funding-page"; +import { HomePage } from "./fixtures/home-page"; +import { Sidebar } from "./fixtures/sidebar"; + +type FundingPageFixtures = { + homePage: HomePage; + sidebar: Sidebar; + fundingPage: FundingPage; + membersPage: MembersPage; + pastMembersPage: PastMembersPage; +}; + +const test = base.extend({ + homePage: async ({ page }, use) => { + const homePage = new HomePage(page); + await use(homePage); + }, + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + fundingPage: async ({ page }, use) => { + const fundingPage = new FundingPage(page); + await use(fundingPage); + }, + membersPage: async ({ page }, use) => { + const membersPage = new MembersPage(page); + await use(membersPage); + }, + pastMembersPage: async ({ page }, use) => { + const pastMembersPage = new PastMembersPage(page); + await use(pastMembersPage); + }, +}); + +test.describe("Resources Pages", () => { + test.beforeEach(async ({ fundingPage }) => { + // Go to the resources url before each test. + await fundingPage.goto(); + }); + test("Donate page", async ({ sidebar, fundingPage }) => { + await expect(sidebar.fundingLink).toBeVisible(); + await sidebar.fundingLink.click(); + await expect(fundingPage.submitButton).toBeVisible(); + await expect(fundingPage.currencyInput).toBeVisible(); + await expect(fundingPage.donateButton).toBeVisible(); + + let donateTextList = fundingPage.textList.find( + (item) => item.page == "Donate", + )?.texts; + + if (donateTextList) { + for (const text of donateTextList) { + await expect(fundingPage.pageBody).toContainText(text); + } + } + + // TODO: Add tests for monthly and one-time tabs + }); + + test("Membership page", async ({ sidebar, fundingPage }) => { + await expect(sidebar.membershipLink).toBeVisible(); + await sidebar.membershipLink.click(); + + let membershipTextList = fundingPage.textList.find( + (item) => item.page == "Membership", + )?.texts; + + if (membershipTextList) { + for (const text of membershipTextList) { + await expect(fundingPage.pageBody).toContainText(text); + } + } + + await expect(fundingPage.becomeSustainingMemberLink).toBeVisible(); + await expect(fundingPage.sustainingMembershipDiv).toBeVisible(); + await expect(fundingPage.sustainingMembershipSection).toBeVisible(); + await expect(fundingPage.writeTrearurerLink).toBeVisible(); + await expect(fundingPage.openSustainingMembersLink).toBeVisible(); + }); + + test("Members page", async ({ sidebar, membersPage }) => { + await sidebar.membershipLink.click(); + await expect(sidebar.membersLink).toBeVisible(); + await sidebar.membersLink.click(); + await expect(membersPage.flagshipHeading).toBeVisible(); + await expect(membersPage.flagshipArticle).toBeVisible(); + await expect(membersPage.largeHeading).toBeVisible(); + await expect(membersPage.largeArticle).toBeVisible(); + }); + + test("Past Members page", async ({ sidebar, pastMembersPage }) => { + await sidebar.membershipLink.click(); + await expect(sidebar.pastMembersLink).toBeVisible(); + await sidebar.pastMembersLink.click(); + for (const text of pastMembersPage.textList) { + await expect(pastMembersPage.pageBody).toContainText(text); + } + }); +}); diff --git a/playwright/ci-test/tests/06-resources-page.spec.ts b/playwright/ci-test/tests/06-resources-page.spec.ts index 712c6ecaa..1ba7f8979 100644 --- a/playwright/ci-test/tests/06-resources-page.spec.ts +++ b/playwright/ci-test/tests/06-resources-page.spec.ts @@ -1,425 +1,268 @@ -import { test, expect } from '@playwright/test'; +import { test as base, expect } from "@playwright/test"; +import { Sidebar } from "./fixtures/sidebar"; +import { QgisResourcesPage } from "./fixtures/qgis-resources-page"; +import { InstallationGuidePage } from "./fixtures/installation-guide-page"; +import { ReleasesPage } from "./fixtures/releases-page"; +import { RoadmapPage } from "./fixtures/roadmap-page"; +import { ReportsPage } from "./fixtures/report-page"; +import { BooksPage } from "./fixtures/books-page"; -let url = '/'; +type ResourcesPageFixtures = { + sidebar: Sidebar; + qgisResourcesPage: QgisResourcesPage; + installationGuidePage: InstallationGuidePage; + releasesPage: ReleasesPage; + roadmapPage: RoadmapPage; + reportsPage: ReportsPage; + booksPage: BooksPage; +}; -test('resources pages', async ({ page }) => { - await page.goto(url); - await page.locator('section').filter({ hasText: 'Free and open source Spatial' }).getByRole('link').click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Resources', exact: true })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Resources' }).getByRole('img')).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Resources', exact: true }).click(); - await expect(page.getByText('Resources ΒΆ πŸ–– Troubles with')).toBeVisible(); - await expect(page.getByText('Troubles with installation? ΒΆ If you are looking for information on installing')).toBeVisible(); - await expect(page.locator('a').filter({ hasText: /^Installation guide$/ })).toBeVisible(); - await expect(page.getByText('QGIS has a lot of')).toBeVisible(); - await expect(page.getByText('You will find documentation')).toBeVisible(); - await expect(page.getByText('Get involved and help us')).toBeVisible(); - await expect(page.locator('p').filter({ hasText: 'Get involved and help us' }).getByRole('link')).toBeVisible(); - await expect(page.locator('#tab-3')).toBeVisible(); - await expect(page.getByText('Archived releases')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Desktop User Guide/Manual' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Server Guide/Manual' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS Training manual' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Introduction in GIS' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Documentation Guidelines' })).toBeVisible(); - await expect(page.getByText('For documentation writers').first()).toBeVisible(); - await expect(page.getByText('For developers').first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'PyQGIS cookbook (for plugins' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'C++ API documentation' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'PyQGIS - QGIS Python Api' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Building QGIS from Source' })).toBeVisible(); - await expect(page.locator('p').filter({ hasText: 'For download' }).first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'PDF of the manuals' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'HTML zip of the manuals' })).toBeVisible(); - await expect(page.getByText('Support ΒΆ The QGIS community')).toBeVisible(); - await expect(page.getByRole('link', { name: 'View support options' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Installation guide' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Installation guide' }).click(); - await expect(page.getByText('QGIS Installers ΒΆ How to')).toBeVisible(); - await expect(page.locator('#qgis-installers')).toContainText('QGIS Installers'); - await expect(page.getByText('How to obtain QGIS?')).toBeVisible(); - await expect(page.getByText('QGIS is available on Windows')).toBeVisible(); - await expect(page.getByText('We recommend installing the')).toBeVisible(); - await expect(page.getByText('To evaluate the upcoming')).toBeVisible(); - await expect(page.getByText('In the feature frozen phase')).toBeVisible(); - await expect(page.locator('p').filter({ hasText: 'To evaluate the upcoming' }).getByRole('link')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Release schedule' })).toBeVisible(); - await expect(page.locator('#windows')).toContainText('Windows'); - await expect(page.getByText('There are two options for')).toBeVisible(); - await expect(page.locator('#standalone-installers')).toContainText('Standalone installers'); - await expect(page.getByText('For beginners the easiest way')).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release', exact: true }).first()).toBeVisible(); - await expect(page.getByRole('row', { name: 'Release Version Package', exact: true }).getByRole('cell').nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Package' }).first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'The main installers page' })).toBeVisible(); - await expect(page.locator('#osgeo4w-installer')).toContainText('OSGeo4W installer'); - await expect(page.getByText('More advanced QGIS users')).toBeVisible(); - await expect(page.getByText('The OSGeo4W repository')).toBeVisible(); - await expect(page.getByText('Download OSGeo4W Installer')).toBeVisible(); - await expect(page.getByRole('link', { name: 'OSGeo4W Installer' })).toBeVisible(); - await expect(page.getByText('Choose Express Install and')).toBeVisible(); - await expect(page.getByText('The packages listed in the')).toBeVisible(); - await expect(page.locator('#linux')).toContainText('Linux'); - await expect(page.getByText('Most linux distributions')).toBeVisible(); - await expect(page.getByText('Below you find instructions')).toBeVisible(); - await expect(page.locator('#debianubuntu')).toContainText('Debian/Ubuntu'); - await expect(page.getByText('Note ΒΆ In the section')).toBeVisible(); - await expect(page.getByText('Note ΒΆ Although you see β€˜')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo apt install gnupg' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo mkdir -m755 -p /etc/apt/' }).first()).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'Types: deb deb-src URIs: https://qgis.org/debian Suites: your-distributions-' })).toBeVisible(); - await expect(page.getByText('Note ΒΆ Suites in above lines')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo apt update' }).first()).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo apt install qgis qgis-' }).first()).toBeVisible(); - await expect(page.getByText('Note ΒΆ Add qgis-server to')).toBeVisible(); - await expect(page.locator('#repositories')).toContainText('Repositories'); - await expect(page.getByText('To have newer versions, you')).toBeVisible(); - await expect(page.getByText('Our main repository contains')).toBeVisible(); - await expect(page.getByText('For Ubuntu we also used to')).toBeVisible(); - await expect(page.getByRole('link', { name: 'ubuntugis', exact: true })).toBeVisible(); - await expect(page.getByRole('link', { name: 'ubuntugis documentation' })).toBeVisible(); - await expect(page.getByText('Note ΒΆ The release packages')).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release', exact: true }).nth(4)).toBeVisible(); - await expect(page.getByRole('row', { name: 'Release Version Description' }).getByRole('cell').nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Description' }).nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Repository' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Latest Release' }).nth(2)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release with ubuntugis-' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release for Debian and Ubuntu' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://qgis.org/debian https' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://qgis.org/ubuntugis', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Nightly build of upcoming' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://qgis.org/debian-nightly-release https://qgis.org/ubuntu-nightly-release' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Nightly build of upcoming' }).nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://qgis.org/ubuntugis-nightly-release' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Long Term Release Repository' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release for Debian and Ubuntu' }).nth(2)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://qgis.org/debian-ltr' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Release with ubuntugis-' }).nth(2)).toBeVisible(); - await expect(page.locator('#available-codenames')).toContainText('Supported distribution versions:'); - await expect(page.getByRole('cell', { name: 'Distribution' }).first()).toBeVisible(); - await expect(page.getByRole('row', { name: 'Distribution Version Codename' }).getByRole('cell').nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Codename' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Also available based on' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'wget https://download.qgis.' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: './qgis-archive-keyring.gpg -------------------------- pub rsa4096 2022-08-08 [' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo mkdir -m755 -p /etc/apt/' }).nth(1)).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo mkdir -m755 -p /etc/apt/' }).nth(2)).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'Types: deb deb-src URIs: *' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo apt update sudo apt install qgis qgis-plugin-grass' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo apt update sudo apt install qgis-server --no-install-recommends --no-' })).toBeVisible(); - await expect(page.getByText('Note ΒΆ Please remove all the')).toBeVisible(); - await expect(page.locator('#fedora')).toContainText('Fedora'); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf install qgis python3-qgis qgis-grass qgis-server' })).toBeVisible(); - await expect(page.locator('#qgis-stable')).toContainText('QGIS stable'); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf copr enable dani/qgis' }).first()).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf install qgis python3' }).nth(1)).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf install qgis-server' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Distribution' }).nth(1)).toBeVisible(); - await expect(page.locator('table').filter({ hasText: 'Distribution Version QGIS version GRASS GIS version Fedora' }).locator('th').nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'QGIS version' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'GRASS GIS version' }).first()).toBeVisible(); - await expect(page.getByText('More information are').first()).toBeVisible(); - await expect(page.locator('#qgis-ltr-long-term-release')).toContainText('QGIS LTR (Long Term Release)'); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf copr enable dani/qgis-ltr' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf install qgis python3' }).nth(2)).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo dnf install qgis-server' }).nth(1)).toBeVisible(); - await expect(page.getByText('More information are').nth(1)).toBeVisible(); - await expect(page.getByRole('link', { name: 'https://copr.fedorainfracloud.org/coprs/dani/qgis-ltr/' })).toBeVisible(); - await expect(page.locator('#suse--opensuse')).toContainText('SUSE / openSUSE'); - await expect(page.getByRole('cell', { name: 'Distribution' }).nth(3)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Repository' }).nth(2)).toBeVisible(); - await expect(page.locator('#mandriva')).toContainText('Mandriva'); - await expect(page.locator('pre').filter({ hasText: 'urpmi qgis-python qgis-grass' })).toBeVisible(); - await expect(page.locator('#slackware')).toContainText('Slackware'); - await expect(page.getByText('Packages on https://')).toBeVisible(); - await expect(page.locator('#arch-linux')).toContainText('Arch Linux'); - await expect(page.getByText('Arch Linux is available in')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'pacman -S qgis' })).toBeVisible(); - await expect(page.locator('#qgis-ltr')).toContainText('QGIS LTR'); - await expect(page.locator('pre').filter({ hasText: 'yaourt -S qgis-ltr' })).toBeVisible(); - await expect(page.locator('#qgis-testing')).toContainText('QGIS testing'); - await expect(page.getByText('yaourt -S qgis-git')).toBeVisible(); - await expect(page.getByText('For bugs and other behaviour').nth(1)).toBeVisible(); - await expect(page.locator('#flatpak')).toContainText('Flatpak'); - await expect(page.getByText('For general Linux Flatpak')).toBeVisible(); - await expect(page.getByText('QGIS on Flathub: https://')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'flatpak install --from https' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'flatpak run org.qgis.qgis' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'flatpak update' })).toBeVisible(); - await expect(page.getByText('Flathub files: https://github')).toBeVisible(); - await expect(page.locator('#spack')).toContainText('Spack'); - await expect(page.getByText('General info on installing')).toBeVisible(); - await expect(page.getByText('QGIS package file on Spack:')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'spack install qgis' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'spack load qgis' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'spack env create myenv spack' })).toBeVisible(); - await expect(page.getByText('Spack related issues should')).toBeVisible(); - await expect(page.locator('#mac-os-x--macos')).toContainText('Mac OS X / macOS'); - await expect(page.getByText('Official All-in-one, signed')).toBeVisible(); - await expect(page.locator('#qgis-nightly-release')).toContainText('QGIS nightly release'); - await expect(page.locator('#macports')).toContainText('MacPorts'); - await expect(page.getByText('The package management system')).toBeVisible(); - await expect(page.getByText('Installing MacPorts and updating it and the ports are made with the Terminal.')).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo port info qgis3' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo port install qgis3 +grass' })).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'sudo port selfupdate sudo' })).toBeVisible(); - await expect(page.getByText('Note ΒΆ Concurrent')).toBeVisible(); - await expect(page.locator('#old-releases')).toContainText('Old releases'); - await expect(page.getByText('Previous releases of the official installer can be downloaded from https://qgis')).toBeVisible(); - await expect(page.getByText('Previous releases of the kyngchaos installer can be downloaded from https://www')).toBeVisible(); - await expect(page.locator('#freebsd')).toContainText('FreeBSD'); - await expect(page.locator('#qgis-stable-4')).toContainText('QGIS stable'); - await expect(page.locator('pre').filter({ hasText: 'pkg install qgis' }).first()).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'cd /usr/ports/graphics/qgis make install clean' })).toBeVisible(); - await expect(page.locator('#qgis-ltr-1')).toContainText('QGIS LTR'); - await expect(page.locator('span').filter({ hasText: 'pkg install qgis-ltr' }).first()).toBeVisible(); - await expect(page.locator('pre').filter({ hasText: 'cd /usr/ports/graphics/qgis-' })).toBeVisible(); - await expect(page.locator('#openbsd')).toContainText('OpenBSD'); - await expect(page.locator('pre').filter({ hasText: 'pkg_add qgis' })).toBeVisible(); - await expect(page.getByText('See: - https://openbsd.app/?')).toBeVisible(); - await expect(page.locator('#android')).toContainText('Android'); - await expect(page.getByText('An old and deprecated not')).toBeVisible(); - await expect(page.getByRole('link', { name: 'https://play.google.com/store' })).toBeVisible(); - await expect(page.getByText('Warning ΒΆ There is currently')).toBeVisible(); - await expect(page.locator('#qgis-testing-warning')).toContainText('QGIS Testing warning'); - await expect(page.getByText('Warning ΒΆ QGIS testing')).toBeVisible(); - await expect(page.locator('#installing-from-source')).toContainText('Installing from Source'); - await expect(page.getByText('Refer to INSTALL on how to')).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Documentation' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Releases', exact: true })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Releases' }).locator('span')).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Releases', exact: true }).click(); - await expect(page.locator('#list-of-releases')).toContainText('List of Releases'); - await expect(page.getByText('Previous releases of QGIS are')).toBeVisible(); - await expect(page.getByText('More older releases are')).toBeVisible(); - await expect(page.getByText('Plugins for QGIS are also')).toBeVisible(); - await expect(page.locator('#tests')).toContainText('Tests'); - await expect(page.getByText('Both QGIS and QGIS server are')).toBeVisible(); - await expect(page.getByText('From build tests (github')).toBeVisible(); - await expect(page.getByText('See Unit testing')).toBeVisible(); - await expect(page.getByText('See OGC conformance testing')).toBeVisible(); - await expect(page.getByText('Recent tests output can be')).toBeVisible(); - await expect(page.getByRole('link', { name: 'List of releases' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Tests' })).toBeVisible(); - await page.getByRole('link', { name: 'Tests' }).click(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Roadmap' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Roadmap' }).click(); - await expect(page.locator('#road-map')).toContainText('Road Map'); - await expect(page.locator('#development-phase')).toContainText('Development phase'); - await expect(page.locator('#feature-freeze')).toContainText('Feature freeze'); - await expect(page.locator('#release')).toContainText('Release'); - await expect(page.locator('#release-schedule')).toContainText('Release schedule'); - await expect(page.locator('#schedule')).toContainText('Schedule'); - await expect(page.getByRole('cell', { name: 'Event' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Latest', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Long-Term Repo' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Freeze', exact: true })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Date' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Week #' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Weeks' })).toBeVisible(); - await expect(page.locator('#event-legend')).toContainText('Event legend'); - await expect(page.getByRole('cell', { name: 'Long term release, begin of' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Regular release, begin of new' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Feature freeze, end of' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Point release of latest' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Extra Point release' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'currently supported releases' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'next releases' })).toBeVisible(); - await expect(page.locator('#qgis-prereleases')).toContainText('Location of prereleases / nightly builds'); - await expect(page.getByRole('cell', { name: 'Platform' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Location' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Windows' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'OSGeo4W' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Linux' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Debian/Ubuntu' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'MacOS' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Mac OS' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Reports', exact: true })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Reports' }).locator('span')).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Reports', exact: true }).click(); - await expect(page.locator('#daily-reports')).toContainText('Daily Reports'); - await expect(page.locator('#ogc-certification')).toContainText('OGC Certification'); - await expect(page.getByText('QGIS Server').first()).toBeVisible(); - await expect(page.locator('p:nth-child(5) > img')).toBeVisible(); - await expect(page.getByText('In order to keep an eye on')).toBeVisible(); - await expect(page.getByText('WMS').first()).toBeVisible(); - await expect(page.getByText('OGC API Features (aka WFS')).toBeVisible(); - await expect(page.getByText('WFS').first()).toBeVisible(); - await expect(page.getByText('Latest reports')).toBeVisible(); - await expect(page.locator('#performance')).toContainText('Performance'); - await expect(page.getByText('At the moment, two tools are')).toBeVisible(); - await expect(page.getByText('The first one is MS-Perfs')).toBeVisible(); - await expect(page.getByText('The second one is Graffiti,')).toBeVisible(); - await expect(page.getByRole('link', { name: 'OGC Certification' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Performance' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Security' })).toBeVisible(); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Books' })).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Books' }).click(); - await expect(page.getByText('Books ΒΆ This page lists books')).toBeVisible(); - await expect(page.locator('#books')).toContainText('Books'); - await expect(page.getByText('This page lists books')).toBeVisible(); - await expect(page.getByText('Please write to psc@qgis.org')).toBeVisible(); - await expect(page.getByText('Note: Books order is newest')).toBeVisible(); - await expect(page.getByRole('link', { name: 'psc@qgis.org' })).toBeVisible(); - await expect(page.locator('#english')).toContainText('English'); - await expect(page.locator('#discover-qgis-3x---second-edition')).toContainText('Discover QGIS'); - await expect(page.locator('#qgis-for-hydrological-applications---second-edition')).toContainText('QGIS for Hydrological Applications - Second Edition'); - await expect(page.locator('#land-use-cover-datasets-and-validation-tools-validation-practices-with-qgis')).toContainText('Land Use Cover Datasets and Validation Tools. Validation Practices with QGIS'); - await expect(page.locator('#introduction-to-qgis')).toContainText('Introduction to QGIS'); - await expect(page.locator('#qgis-for-hydrological-applications')).toContainText('QGIS for Hydrological applications'); - await expect(page.locator('#chinese')).toContainText('Chinese'); - await expect(page.locator('#dutch')).toContainText('Dutch'); - await expect(page.locator('#french')).toContainText('French'); - await expect(page.locator('#greek')).toContainText('Greek'); - await expect(page.locator('#japanese')).toContainText('Japanese'); - await expect(page.locator('#polish')).toContainText('Polish'); - await expect(page.locator('#turkish')).toContainText('Turkish'); - await expect(page.locator('#sidebar').getByRole('link', { name: 'Support', exact: true })).toBeVisible(); - await expect(page.locator('#sidebar div').filter({ hasText: 'Support' }).locator('span')).toBeVisible(); - await page.locator('#sidebar').getByRole('link', { name: 'Support', exact: true }).click(); - await expect(page.locator('#support')).toContainText('Support'); - await expect(page.locator('#mailing-lists')).toContainText('Mailing Lists'); - await expect(page.getByText('QGIS has a bunch of mailing')).toBeVisible(); - await expect(page.getByText('If you are going to ask')).toBeVisible(); - await expect(page.locator('#stackexchange')).toContainText('StackExchange'); - await expect(page.getByText('On http://gis.stackexchange.')).toBeVisible(); - await expect(page.locator('#communication-channels')).toContainText('Communication channels'); - await expect(page.locator('#telegram')).toContainText('Telegram'); - await expect(page.getByText('There is a lot of user and')).toBeVisible(); - await expect(page.getByText('To join: install Telegram on')).toBeVisible(); - await expect(page.getByText('There is also a web version (')).toBeVisible(); - await expect(page.locator('#matrix--irc')).toContainText('Matrix / IRC'); - await expect(page.getByText('Matrix (https://matrix.org)')).toBeVisible(); - await expect(page.getByText('To use Matrix: create an')).toBeVisible(); - await expect(page.getByText('To use IRC: install an IRC')).toBeVisible(); - await expect(page.locator('#facebook')).toContainText('Facebook'); - await expect(page.getByText('For Facebook users, an')).toBeVisible(); - await expect(page.locator('#user-groups')).toContainText('User Groups'); - await expect(page.getByText('Local QGIS user groups are a')).toBeVisible(); - await expect(page.getByText('See User Groups to read about')).toBeVisible(); - await expect(page.locator('#website')).toContainText('Website'); - await expect(page.getByText('The website should be used to')).toBeVisible(); - await expect(page.getByText('Good luck with the')).toBeVisible(); - await expect(page.getByRole('link', { name: 'FAQ' })).toBeVisible(); - await page.getByRole('link', { name: 'FAQ' }).click(); - await expect(page.locator('#faq')).toContainText('FAQ'); - await expect(page.getByText('Here we collect answers to')).toBeVisible(); - await expect(page.getByText('We will start of with this')).toBeVisible(); - await expect(page.locator('#user')).toContainText('User'); - await expect(page.locator('#downloading-issues')).toContainText('Downloading issues'); - await expect(page.getByText('If you are trying to download')).toBeVisible(); - await expect(page.locator('#i-have-to-donate-in-order-to-download-qgis')).toContainText('I have to donate in order to download QGIS'); - await expect(page.getByText('This is a misconception that')).toBeVisible(); - await expect(page.locator('#how-to-ask-a-qgis-question')).toContainText('How to ask a QGIS question?'); - await expect(page.getByText('If you are going to ask QGIS')).toBeVisible(); - await expect(page.getByText('Keep in mind that the more')).toBeVisible(); - await expect(page.getByText('Note ΒΆ In case of a broken')).toBeVisible(); - await expect(page.getByRole('link', { name: 'QGIS issue tracker' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'bug-reporting' })).toBeVisible(); - await expect(page.locator('#how-are-qgis-release-names-selected')).toContainText('How are QGIS release names selected?'); - await expect(page.getByText('After a successful developer')).toBeVisible(); - await expect(page.locator('#how-to-cite-qgis')).toContainText('How to cite QGIS?'); - await expect(page.getByText('To cite QGIS in your piece of')).toBeVisible(); - await expect(page.locator('section')).toContainText('Cite the QGIS project in general'); - await expect(page.getByText('QGIS.org, %%Y. QGIS Geographic Information System. QGIS Association.')).toBeVisible(); - await expect(page.getByRole('link', { name: 'http://www.qgis.org' })).toBeVisible(); - await expect(page.getByText('Cite the QGIS Developers')).toBeVisible(); - await expect(page.getByText('Geographic Information System Developers Manual. QGIS Association.').first()).toBeVisible(); - await expect(page.getByText('Cite the QGIS Installation')).toBeVisible(); - await expect(page.getByText('Geographic Information System Installation Guide. QGIS Association.').first()).toBeVisible(); - await expect(page.getByRole('link', { name: 'https://github.com/qgis/QGIS/' })).toBeVisible(); - await expect(page.locator('p').filter({ hasText: 'Cite the QGIS User Guide' })).toBeVisible(); - await expect(page.getByText('Geographic Information System User Guide. QGIS Association.')).toBeVisible(); - await expect(page.getByText('Cite the QGIS Server')).toBeVisible(); - await expect(page.getByText('Geographic Information System API Documentation. QGIS Association.').first()).toBeVisible(); - await expect(page.getByText('Cite the QGIS API')).toBeVisible(); - await expect(page.getByText('Geographic Information System API Documentation. QGIS Association.').first()).toBeVisible(); - await expect(page.getByText('Preferred format: BibTeX')).toBeVisible(); - await expect(page.locator('pre')).toBeVisible(); - await expect(page.locator('#i-created-a-map-with-qgis-do-i-have-to-mention-qgis')).toContainText('I created a map with QGIS, do I have to mention QGIS?'); - await expect(page.getByText('There is no requirement to')).toBeVisible(); - await expect(page.getByText('Note ΒΆ Do not say Β©QGIS as')).toBeVisible(); - await expect(page.locator('#can-i-open-ecw-files-with-qgis')).toContainText('Can I open ECW files with QGIS?'); - await expect(page.getByText('Yes you can… BUT depending on')).toBeVisible(); - await expect(page.getByText('If you are under Windows and')).toBeVisible(); - await expect(page.getByText('If you are using macOS, you')).toBeVisible(); - await expect(page.getByRole('link', { name: 'https://www.kyngchaos.com/' })).toBeVisible(); - await expect(page.getByText('For other instructions, eg')).toBeVisible(); - await expect(page.getByRole('link', { name: 'https://www.faunalia.eu/en/' })).toBeVisible(); - await expect(page.locator('#development')).toContainText('Development'); - await expect(page.locator('#can-i-compile-qgis-myself')).toContainText('Can I compile QGIS myself?'); - await expect(page.getByText('Yes, compiling QGIS from')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Building QGIS from source' })).toBeVisible(); - await expect(page.getByRole('link', { name: 'Bug Reporting' })).toBeVisible(); - await page.getByRole('link', { name: 'Bug Reporting' }).click(); - await expect(page.getByText('Bugs, Features and Issues ΒΆ QGIS is a largely volunteer driven project, and is')).toBeVisible(); - await expect(page.locator('#bugs-features-and-issues')).toContainText('Bugs, Features and Issues'); - await expect(page.getByText('QGIS is a largely volunteer')).toBeVisible(); - await expect(page.locator('#where-to-report')).toContainText('Where to report?'); - await expect(page.getByText('Each part of the QGIS Project')).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Place you found the bug or' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Place to report the issue' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'Applications (QGIS Desktop,' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://github.com/qgis/QGIS/' }).first()).toBeVisible(); - await expect(page.getByRole('cell', { name: 'QGIS Website (https://qgis.' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://github.com/qgis/QGIS-Website/issues' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'QGIS Documentation (https://' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://github.com/qgis/QGIS-Documentation/issues' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'C++ API (https://qgis.org/api' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://github.com/qgis/QGIS/' }).nth(1)).toBeVisible(); - await expect(page.getByRole('cell', { name: 'PyQGIS API (https://qgis.org/' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'https://github.com/qgis/QGIS/issues (for contents) and https://github.com/qgis/' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'External plugins' })).toBeVisible(); - await expect(page.getByRole('cell', { name: 'The author repository set in' })).toBeVisible(); - await expect(page.getByText('For help and questions,')).toBeVisible(); - await expect(page.locator('#reporting-issues-on-qgis-applications')).toContainText('Reporting issues on QGIS applications'); - await expect(page.getByText('QGIS applications (QGIS')).toBeVisible(); - await expect(page.locator('#before-reporting-an-issue')).toContainText('Before reporting an issue'); - await expect(page.getByText('Before filing an issue,')).toBeVisible(); - await expect(page.getByText('When you’re are logged in, a')).toBeVisible(); - await expect(page.getByText('Before sending the report,')).toBeVisible(); - await expect(page.locator('#creating-a-backtrace')).toContainText('Creating a backtrace'); - await expect(page.getByText('If you have a crash it might')).toBeVisible(); - await expect(page.getByText('On Linux QGIS automatically')).toBeVisible(); - await expect(page.getByText('QGIS died on signal 11Could')).toBeVisible(); - await expect(page.getByText('In that case you should')).toBeVisible(); - await expect(page.getByText('If you cannot reproduce the')).toBeVisible(); - await expect(page.getByText('On some distributions the')).toBeVisible(); - await expect(page.getByText('To produce a backtrace from')).toBeVisible(); - await expect(page.locator('#log-output-on-windows')).toContainText('Log output on Windows'); - await expect(page.getByText('The nightly build in OSGeo4W')).toBeVisible(); - await expect(page.locator('#reporting-issues-on-qgis-web-site-or-documentation')).toContainText('Reporting issues on QGIS web site or documentation'); - await expect(page.getByText('QGIS project provides an')).toBeVisible(); - await expect(page.getByText('The main sources of these')).toBeVisible(); - await expect(page.getByText('To get started, first Create')).toBeVisible(); - await expect(page.getByText('Then, choose the appropriate')).toBeVisible(); - await expect(page.getByText('https://github.com/qgis/QGIS-Documentation/issues for QGIS documentation')).toBeVisible(); - await expect(page.getByText('https://github.com/qgis/QGIS-Website/issues for the web site')).toBeVisible(); - await expect(page.getByText('Check if the issue you’d like')).toBeVisible(); - await expect(page.locator('#reporting-plugin-issues')).toContainText('Reporting plugin issues'); - await expect(page.getByText('Most of the plugins in QGIS')).toBeVisible(); - await expect(page.getByText('For any plugin available in')).toBeVisible(); - await expect(page.getByText('If no information is')).toBeVisible(); - await expect(page.getByText('For other plugins, we have no')).toBeVisible(); - await expect(page.locator('#submitting-a-patch-to-qgis-projects')).toContainText('Submitting a Patch to QGIS projects'); - await expect(page.getByText('In addition to issue report,')).toBeVisible(); - await expect(page.getByText('https://github.com/qgis/QGIS for QGIS Desktop or QGIS Server applications')).toBeVisible(); - await expect(page.getByText('https://github.com/qgis/QGIS-Website for the web site at https://qgis.org')).toBeVisible(); - await expect(page.getByText('https://github.com/qgis/QGIS-Documentation for the documentation available at')).toBeVisible(); - await expect(page.getByText('You can find a few guidelines')).toBeVisible(); - await expect(page.getByRole('link', { name: 'Communication channels' })).toBeVisible(); - await page.getByRole('link', { name: 'Communication channels' }).click(); - await expect(page.getByRole('link', { name: 'Commercial support' })).toBeVisible(); - await page.getByRole('link', { name: 'Commercial support' }).click(); - await expect(page.getByText('Commercial support ΒΆ Do you')).toBeVisible(); - await expect(page.locator('#commercial-support')).toContainText('Commercial support'); - await expect(page.getByText('Do you plan to use QGIS in')).toBeVisible(); - await expect(page.getByText('Note ΒΆ we take responsibility')).toBeVisible(); - await expect(page.locator('#core-contributors')).toContainText('Core contributors'); - await expect(page.getByText('3liz (based in France) offers')).toBeVisible(); - await expect(page.getByRole('link', { name: 'StackExchange' })).toBeVisible(); - await page.getByRole('link', { name: 'StackExchange' }).click(); - await expect(page.getByRole('link', { name: 'Website Creation' })).toBeVisible(); - await page.getByRole('link', { name: 'Website Creation' }).click(); +const test = base.extend({ + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + qgisResourcesPage: async ({ page }, use) => { + const qgisResourcesPage = new QgisResourcesPage(page); + await use(qgisResourcesPage); + }, + installationGuidePage: async ({ page }, use) => { + const installationGuidePage = new InstallationGuidePage(page); + await use(installationGuidePage); + }, + releasesPage: async ({ page }, use) => { + const releasesPage = new ReleasesPage(page); + await use(releasesPage); + }, + roadmapPage: async ({ page }, use) => { + const roadmapPage = new RoadmapPage(page); + await use(roadmapPage); + }, + reportsPage: async ({ page }, use) => { + const reportsPage = new ReportsPage(page); + await use(reportsPage); + }, + booksPage: async ({ page }, use) => { + const booksPage = new BooksPage(page); + await use(booksPage); + }, +}); + +test.describe("Resources pages", () => { + test.beforeEach(async ({ qgisResourcesPage }) => { + // Go to the resources url before each test. + await qgisResourcesPage.goto(); + }); + + test("QGIS resources", async ({ sidebar, qgisResourcesPage }) => { + await expect(sidebar.resourcesLink).toBeVisible(); + await sidebar.resourcesLink.click(); + await expect(qgisResourcesPage.installationGuideLink).toBeVisible(); + await expect(qgisResourcesPage.getInvolvedLink).toBeVisible(); + await expect(qgisResourcesPage.tab3Element).toBeVisible(); + await expect(qgisResourcesPage.desktopUserGuideLink).toBeVisible(); + await expect(qgisResourcesPage.serverGuideLink).toBeVisible(); + await expect(qgisResourcesPage.qgisTrainingManualLink).toBeVisible(); + await expect(qgisResourcesPage.introductionInGISLink).toBeVisible(); + await expect( + qgisResourcesPage.documentationGuidelinesLink, + ).toBeVisible(); + await expect(qgisResourcesPage.pyQGISCookbookLink).toBeVisible(); + await expect( + qgisResourcesPage.cPlusPlusAPIDocumentationLink, + ).toBeVisible(); + await expect(qgisResourcesPage.pyQGISApiLink).toBeVisible(); + await expect( + qgisResourcesPage.buildingQGISFromSourceLink, + ).toBeVisible(); + await expect(qgisResourcesPage.forDownloadParagraph).toBeVisible(); + await expect(qgisResourcesPage.pdfManualsLink).toBeVisible(); + await expect(qgisResourcesPage.htmlZipManualsLink).toBeVisible(); + await expect(qgisResourcesPage.viewSupportOptionsLink).toBeVisible(); + + for (const text of qgisResourcesPage.textList) { + await expect(qgisResourcesPage.pageBody).toContainText(text); + } + }); + + test("Installation guide", async ({ sidebar, installationGuidePage }) => { + await expect(sidebar.installationGuideLink).toBeVisible(); + await sidebar.installationGuideLink.click(); + await expect( + installationGuidePage.upcomingEvaluationLink, + ).toBeVisible(); + await expect(installationGuidePage.releaseScheduleLink).toBeVisible(); + await expect(installationGuidePage.releaseCell1).toBeVisible(); + await expect( + installationGuidePage.releaseVersionPackageCell, + ).toBeVisible(); + await expect(installationGuidePage.packageCell).toBeVisible(); + await expect( + installationGuidePage.mainInstallersPageLink, + ).toBeVisible(); + await expect(installationGuidePage.osgeo4WInstallerLink).toBeVisible(); + await expect(installationGuidePage.aptInstallGnupgPre).toBeVisible(); + await expect(installationGuidePage.aptInstallAptPre).toBeVisible(); + await expect(installationGuidePage.aptUpdatePre).toBeVisible(); + await expect(installationGuidePage.aptInstallQgisPre).toBeVisible(); + await expect(installationGuidePage.ubuntugisLink).toBeVisible(); + await expect( + installationGuidePage.ubuntugisDocumentationLink, + ).toBeVisible(); + await expect(installationGuidePage.releaseCell4).toBeVisible(); + await expect( + installationGuidePage.releaseVersionDescriptionCell, + ).toBeVisible(); + await expect(installationGuidePage.descriptionCell).toBeVisible(); + await expect(installationGuidePage.repositoryCell).toBeVisible(); + await expect(installationGuidePage.latestReleaseCell).toBeVisible(); + await expect( + installationGuidePage.releaseWithUbuntugisCell, + ).toBeVisible(); + await expect( + installationGuidePage.releaseDebianUbuntuCell, + ).toBeVisible(); + await expect( + installationGuidePage.releaseDebianUbuntuLink, + ).toBeVisible(); + await expect(installationGuidePage.releaseUbuntugisCell).toBeVisible(); + await expect( + installationGuidePage.longTermReleaseRepositoryCell, + ).toBeVisible(); + await expect( + installationGuidePage.releaseDebianUbuntuCell2, + ).toBeVisible(); + await expect(installationGuidePage.releaseDebianLtrLink).toBeVisible(); + await expect( + installationGuidePage.releaseWithUbuntugisCell2, + ).toBeVisible(); + await expect(installationGuidePage.distributionCell).toBeVisible(); + await expect( + installationGuidePage.distributionVersionCodenameCell, + ).toBeVisible(); + await expect(installationGuidePage.codenameCell).toBeVisible(); + await expect( + installationGuidePage.alsoAvailableBasedOnCell, + ).toBeVisible(); + await expect(installationGuidePage.wgetQgisPre).toBeVisible(); + await expect(installationGuidePage.qgisArchiveKeyringPre).toBeVisible(); + await expect(installationGuidePage.mkdirAptPre1).toBeVisible(); + await expect(installationGuidePage.mkdirAptPre2).toBeVisible(); + await expect( + installationGuidePage.aptUpdateInstallQgisPre, + ).toBeVisible(); + await expect( + installationGuidePage.aptUpdateInstallQgisServerPre, + ).toBeVisible(); + await expect(installationGuidePage.dnfInstallQgisPre).toBeVisible(); + await expect(installationGuidePage.dnfCoprEnableQgisPre1).toBeVisible(); + await expect( + installationGuidePage.dnfInstallQgisPythonPre, + ).toBeVisible(); + await expect( + installationGuidePage.dnfInstallQgisServerPre, + ).toBeVisible(); + await expect(installationGuidePage.distributionCell2).toBeVisible(); + await expect(installationGuidePage.distGrassFedora).toBeVisible(); + await expect(installationGuidePage.qgisVersionCell).toBeVisible(); + await expect(installationGuidePage.grassGisVersionCell).toBeVisible(); + await expect(installationGuidePage.dnfCoprEnableQgisPre2).toBeVisible(); + await expect( + installationGuidePage.dnfInstallQgisPythonPre2, + ).toBeVisible(); + await expect( + installationGuidePage.dnfInstallQgisServerPre2, + ).toBeVisible(); + await expect(installationGuidePage.fedoraCoprLink).toBeVisible(); + await expect(installationGuidePage.distributionCell3).toBeVisible(); + await expect(installationGuidePage.repositoryCell2).toBeVisible(); + await expect(installationGuidePage.urpmiQgisPre).toBeVisible(); + await expect(installationGuidePage.pacmanQgisPre).toBeVisible(); + await expect(installationGuidePage.yaourtQgisLtrPre).toBeVisible(); + await expect(installationGuidePage.flatpakInstallPre).toBeVisible(); + await expect(installationGuidePage.flatpakRunPre).toBeVisible(); + await expect(installationGuidePage.flatpakUpdatePre).toBeVisible(); + await expect(installationGuidePage.spackInstallQgisPre).toBeVisible(); + await expect(installationGuidePage.spackLoadQgisPre).toBeVisible(); + await expect(installationGuidePage.spackEnvCreatePre).toBeVisible(); + await expect(installationGuidePage.portInfoQgis3Pre).toBeVisible(); + await expect(installationGuidePage.portInstallQgis3Pre).toBeVisible(); + await expect(installationGuidePage.portSelfupdatePre).toBeVisible(); + await expect(installationGuidePage.pkgInstallQgisPre).toBeVisible(); + await expect(installationGuidePage.makeInstallQgisPre).toBeVisible(); + await expect(installationGuidePage.pkgInstallQgisLtrSpan).toBeVisible(); + await expect(installationGuidePage.makeInstallQgisLtrPre).toBeVisible(); + await expect(installationGuidePage.pkgAddQgisPre).toBeVisible(); + await expect(installationGuidePage.googlePlayLink).toBeVisible(); + await expect(sidebar.documentationLink).toBeVisible(); + + for (const text of installationGuidePage.textList) { + await expect(installationGuidePage.pageBody).toContainText(text); + } + }); + + test("Releases", async ({ page, sidebar, releasesPage }) => { + await expect(sidebar.releasesLink).toBeVisible(); + await sidebar.releasesLink.click(); + + for (const text of releasesPage.textList) { + await expect(releasesPage.pageBody).toContainText(text); + } + await expect(releasesPage.listOfReleasesLink).toBeVisible(); + await expect(releasesPage.testsLink).toBeVisible(); + await releasesPage.testsLink.click(); + }); + + test("Roadmap", async ({ sidebar, roadmapPage }) => { + await expect(sidebar.roadmapLink).toBeVisible(); + await sidebar.roadmapLink.click(); + await expect(roadmapPage.event).toBeVisible(); + await expect(roadmapPage.latest).toBeVisible(); + await expect(roadmapPage.longTermRepo).toBeVisible(); + await expect(roadmapPage.freeze).toBeVisible(); + await expect(roadmapPage.date).toBeVisible(); + await expect(roadmapPage.weekNumber).toBeVisible(); + await expect(roadmapPage.weeks).toBeVisible(); + await expect(roadmapPage.longTermReleaseBegin).toBeVisible(); + await expect(roadmapPage.regularReleaseBegin).toBeVisible(); + await expect(roadmapPage.featureFreezeEnd).toBeVisible(); + await expect(roadmapPage.pointReleaseLatest).toBeVisible(); + await expect(roadmapPage.extraPointRelease).toBeVisible(); + await expect(roadmapPage.currentlySupportedReleases).toBeVisible(); + await expect(roadmapPage.nextReleases).toBeVisible(); + await expect(roadmapPage.platform).toBeVisible(); + await expect(roadmapPage.location).toBeVisible(); + await expect(roadmapPage.windows).toBeVisible(); + await expect(roadmapPage.osgeo4w).toBeVisible(); + await expect(roadmapPage.linux).toBeVisible(); + await expect(roadmapPage.debianUbuntu).toBeVisible(); + await expect(roadmapPage.macOS).toBeVisible(); + + for (const text of roadmapPage.textList) { + await expect(roadmapPage.pageBody).toContainText(text); + } + }); + + test("Reports", async ({ page, sidebar, reportsPage }) => { + await expect(sidebar.reportsLink).toBeVisible(); + await sidebar.reportsLink.click(); + await expect(reportsPage.certificationImage).toBeVisible(); + await expect(reportsPage.ogcCertificationLink).toBeVisible(); + await expect(reportsPage.performanceLink).toBeVisible(); + await expect(reportsPage.securityLink).toBeVisible(); + + for (const text of reportsPage.textList) { + await expect(reportsPage.pageBody).toContainText(text); + } + }); + + test("Books", async ({ sidebar, booksPage }) => { + await expect(sidebar.booksLink).toBeVisible(); + await sidebar.booksLink.click(); + await expect(booksPage.contactLink).toBeVisible(); + + for (const text of booksPage.textList) { + await expect(booksPage.pageBody).toContainText(text); + } + }); }); diff --git a/playwright/ci-test/tests/07-support-pages.spec.ts b/playwright/ci-test/tests/07-support-pages.spec.ts new file mode 100644 index 000000000..02e34de44 --- /dev/null +++ b/playwright/ci-test/tests/07-support-pages.spec.ts @@ -0,0 +1,108 @@ +import { test as base, expect } from "@playwright/test"; +import { Sidebar } from "./fixtures/sidebar"; +import { OtherSupportPage, SupportPage } from "./fixtures/support-page"; +import { FaqPage } from "./fixtures/faq-page"; +import { BugReportingPage } from "./fixtures/bug-reporting-page"; + +type SupportPageFixtures = { + sidebar: Sidebar; + supportPage: SupportPage; + faqPage: FaqPage; + bugReporting: BugReportingPage; + otherSupportPage: OtherSupportPage; +}; + +const test = base.extend({ + sidebar: async ({ page }, use) => { + const sidebar = new Sidebar(page); + await use(sidebar); + }, + supportPage: async ({ page }, use) => { + const supportPage = new SupportPage(page); + await use(supportPage); + }, + faqPage: async ({ page }, use) => { + const faqPage = new FaqPage(page); + await use(faqPage); + }, + bugReporting: async ({ page }, use) => { + const bugReporting = new BugReportingPage(page); + await use(bugReporting); + }, + otherSupportPage: async ({ page }, use) => { + const otherSupportPage = new OtherSupportPage(page); + await use(otherSupportPage); + }, +}); + +test.describe("Resources Pages", () => { + test.beforeEach(async ({ supportPage }) => { + // Go to the resources url before each test. + await supportPage.goto(); + }); + + test("Support", async ({ sidebar, supportPage }) => { + await expect(sidebar.supportLink).toBeVisible(); + await sidebar.supportLink.click(); + for (const text of supportPage.textList) { + await expect(supportPage.pageBody).toContainText(text); + } + }); + + test("FAQ", async ({ page, faqPage }) => { + await expect(faqPage.faqLink).toBeVisible(); + await faqPage.faqLink.click(); + await expect(faqPage.qgisIssueTrackerLink).toBeVisible(); + await expect(faqPage.bugReportingLink).toBeVisible(); + await expect(faqPage.qgisWebsiteLink).toBeVisible(); + await expect(faqPage.qgisGitHubLink).toBeVisible(); + await expect(faqPage.citeQGISUserGuide).toBeVisible(); + await expect(faqPage.preElements).toBeVisible(); + await expect(faqPage.kyngchaosLink).toBeVisible(); + await expect(faqPage.faunaliaLink).toBeVisible(); + await expect(faqPage.buildingQGISFromSourceLink).toBeVisible(); + + for (const text of faqPage.textList) { + await expect(faqPage.pageBody).toContainText(text); + } + }); + + test("Bug Reporting", async ({ page, bugReporting }) => { + await expect(bugReporting.bugReportingLink).toBeVisible(); + await bugReporting.bugReportingLink.click(); + await expect(bugReporting.bugPlaceFoundCell).toBeVisible(); + await expect(bugReporting.bugReportIssueCell).toBeVisible(); + await expect(bugReporting.qgisDesktopCell).toBeVisible(); + await expect(bugReporting.qgisGitHubLink).toBeVisible(); + await expect(bugReporting.qgisWebsiteCell).toBeVisible(); + await expect(bugReporting.qgisWebsiteGitHubLink).toBeVisible(); + await expect(bugReporting.qgisDocumentationCell).toBeVisible(); + await expect(bugReporting.qgisDocumentationGitHubLink).toBeVisible(); + await expect(bugReporting.cppAPICell).toBeVisible(); + await expect(bugReporting.cppAPIGitHubLink).toBeVisible(); + await expect(bugReporting.pyQGISAPICell).toBeVisible(); + await expect(bugReporting.pyQGISAPIGitHubLink).toBeVisible(); + await expect(bugReporting.externalPluginsCell).toBeVisible(); + await expect(bugReporting.authorRepositoryCell).toBeVisible(); + + for (const text of bugReporting.textList) { + await expect(bugReporting.pageBody).toContainText(text); + } + }); + + test("Other support links", async ({ page, otherSupportPage }) => { + await expect(otherSupportPage.communicationChannelsLink).toBeVisible(); + await otherSupportPage.navigateToCommunicationChannels(); + await expect(otherSupportPage.commercialSupportLink).toBeVisible(); + await otherSupportPage.navigateToCommercialSupport(); + + for (const text of otherSupportPage.textList) { + await expect(otherSupportPage.pageBody).toContainText(text); + } + + await expect(otherSupportPage.stackExchangeLink).toBeVisible(); + await otherSupportPage.navigateToStackExchange(); + await expect(otherSupportPage.websiteCreationLink).toBeVisible(); + await otherSupportPage.navigateToWebsiteCreation(); + }); +}); diff --git a/playwright/ci-test/tests/fixtures/books-page.ts b/playwright/ci-test/tests/fixtures/books-page.ts new file mode 100644 index 000000000..9403183c2 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/books-page.ts @@ -0,0 +1,32 @@ +import type { Page, Locator } from "@playwright/test"; + +export class BooksPage { + public readonly pageBody: Locator; + public readonly contactLink: Locator; + public readonly textList: string[] = [ + "Books ΒΆ This page lists books", + "This page lists books", + "Please write to psc@qgis.org", + "Note: Books order is newest", + "Books", + "English", + "Discover QGIS", + "QGIS for Hydrological Applications - Second Edition", + "Land Use Cover Datasets and Validation Tools. Validation Practices with QGIS", + "Introduction to QGIS", + "QGIS for Hydrological applications", + "Chinese", + "Dutch", + "French", + "Greek", + "Japanese", + "Polish", + "Turkish", + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.contactLink = this.page.getByRole("link", { + name: "psc@qgis.org", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/bug-reporting-page.ts b/playwright/ci-test/tests/fixtures/bug-reporting-page.ts new file mode 100644 index 000000000..cf7815065 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/bug-reporting-page.ts @@ -0,0 +1,115 @@ +import type { Page, Locator } from "@playwright/test"; + +export class BugReportingPage { + public readonly pageBody: Locator; + public readonly bugReportingLink: Locator; + public readonly bugPlaceFoundCell: Locator; + public readonly bugReportIssueCell: Locator; + public readonly qgisDesktopCell: Locator; + public readonly qgisGitHubLink: Locator; + public readonly qgisWebsiteCell: Locator; + public readonly qgisWebsiteGitHubLink: Locator; + public readonly qgisDocumentationCell: Locator; + public readonly qgisDocumentationGitHubLink: Locator; + public readonly cppAPICell: Locator; + public readonly cppAPIGitHubLink: Locator; + public readonly pyQGISAPICell: Locator; + public readonly pyQGISAPIGitHubLink: Locator; + public readonly externalPluginsCell: Locator; + public readonly authorRepositoryCell: Locator; + public readonly textList: string[] = [ + "Bugs, Features and Issues ΒΆ QGIS is a largely volunteer driven project, and is", + "QGIS is a largely volunteer", + "Each part of the QGIS Project", + "For help and questions,", + "QGIS applications (QGIS", + "Before filing an issue,", + "When you’re are logged in, a", + "Before sending the report,", + "If you have a crash it might", + "On Linux QGIS automatically", + "QGIS died on signal 11Could", + "In that case you should", + "If you cannot reproduce the", + "On some distributions the", + "To produce a backtrace from", + "The nightly build in OSGeo4W", + "QGIS project provides an", + "The main sources of these", + "To get started, first Create", + "Then, choose the appropriate", + "https://github.com/qgis/QGIS-Documentation/issues for QGIS documentation", + "https://github.com/qgis/QGIS-Website/issues for the web site", + "Check if the issue you’d like", + "Most of the plugins in QGIS", + "For any plugin available in", + "If no information is", + "For other plugins, we have no", + "In addition to issue report,", + "https://github.com/qgis/QGIS for QGIS Desktop or QGIS Server applications", + "https://github.com/qgis/QGIS-Website for the web site at https://qgis.org", + "https://github.com/qgis/QGIS-Documentation for the documentation available at", + "You can find a few guidelines", + "Bugs, Features and Issues", + "Where to report?", + "Reporting issues on QGIS applications", + "Before reporting an issue", + "Creating a backtrace", + "Log output on Windows", + "Reporting issues on QGIS web site or documentation", + "Reporting plugin issues", + "Submitting a Patch to QGIS projects", + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.bugReportingLink = this.page.getByRole("link", { + name: "Bug Reporting", + }); + this.bugPlaceFoundCell = this.page.getByRole("cell", { + name: "Place you found the bug or", + }); + this.bugReportIssueCell = this.page.getByRole("cell", { + name: "Place to report the issue", + }); + this.qgisDesktopCell = this.page.getByRole("cell", { + name: "Applications (QGIS Desktop,", + }); + this.qgisGitHubLink = this.page + .getByRole("cell", { + name: "https://github.com/qgis/QGIS/", + }) + .first(); + this.qgisWebsiteCell = this.page.getByRole("cell", { + name: "QGIS Website (https://qgis.", + }); + this.qgisWebsiteGitHubLink = this.page.getByRole("cell", { + name: "https://github.com/qgis/QGIS-Website/issues", + }); + this.qgisDocumentationCell = this.page.getByRole("cell", { + name: "QGIS Documentation (https://", + }); + this.qgisDocumentationGitHubLink = this.page.getByRole("cell", { + name: "https://github.com/qgis/QGIS-Documentation/issues", + }); + this.cppAPICell = this.page.getByRole("cell", { + name: "C++ API (https://qgis.org/api", + }); + this.cppAPIGitHubLink = this.page + .getByRole("cell", { + name: "https://github.com/qgis/QGIS/", + }) + .first(); + this.pyQGISAPICell = this.page.getByRole("cell", { + name: "PyQGIS API (https://qgis.org/", + }); + this.pyQGISAPIGitHubLink = this.page.getByRole("cell", { + name: "https://github.com/qgis/QGIS/issues (for contents) and https://github.com/qgis/", + }); + this.externalPluginsCell = this.page.getByRole("cell", { + name: "External plugins", + }); + this.authorRepositoryCell = this.page.getByRole("cell", { + name: "The author repository set in", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/community-page.ts b/playwright/ci-test/tests/fixtures/community-page.ts new file mode 100644 index 000000000..b51211313 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/community-page.ts @@ -0,0 +1,217 @@ +import type { Page, Locator } from "@playwright/test"; +import { TextList } from "./interfaces"; + +export class CommunityPage { + private readonly url: string = "/community/involve/"; + public readonly pageBody: Locator; + public readonly participateSupportLink: Locator; + public readonly reportBugsLink: Locator; + public readonly qgisDocumentationLink: Locator; + public readonly translateQGISLink: Locator; + public readonly developPluginLink: Locator; + public readonly developQGISCoreLink: Locator; + public readonly sustainDonateLink: Locator; + public readonly submitButton: Locator; + public readonly otherMethodsInfoLink: Locator; + public readonly currencyInput: Locator; + public readonly workflowCertificationImg: Locator; + public readonly charterLink: Locator; + public readonly annualGeneralMeetingsLink: Locator; + public readonly annualReportsLink: Locator; + public readonly financeLink: Locator; + public readonly infrastructureLink: Locator; + public readonly brandGuidelinesLink: Locator; + public readonly contributorCreditsLink: Locator; + public readonly committeeResolutionsLink: Locator; + public readonly meetingsLink: Locator; + public readonly goToMeetingsFirstLink: Locator; + public readonly goToMeetingsNthLink: Locator; + public readonly mailingListsLink: Locator; + public readonly qgisUsersListLink: Locator; + public readonly qgisDevelopersListLink: Locator; + public readonly qgisCommunityTeamLink: Locator; + public readonly qgisTranslationsLink: Locator; + public readonly qgisProjectSteeringLink: Locator; + public readonly qgisWebClientLink: Locator; + + public readonly textList: TextList[] = [ + { + page: "Get involved", + texts: [ + "Ways of Contributing ΒΆ Participate in Support Channels Report Bugs QGIS", + "Participate in Support Channels ΒΆ User groups πŸ‡©πŸ‡ͺ πŸ‡«πŸ‡· πŸ‡ͺπŸ‡Έ", + "Report Bugs ΒΆ If you", + "QGIS Documentation ΒΆ Creating", + "Translate QGIS ΒΆ If you’re", + "Develop a Plugin ΒΆ Interested", + "Develop QGIS Core ΒΆ QGIS Core", + "Sustain & Donate ΒΆ We welcome", + ], + }, + { + page: "Become a certified member", + texts: [ + "Become a certified member ΒΆ The QGIS Certificate Program is designed to promote", + "The QGIS Certificate Program", + "Development/commits to QGIS Contributions to the QGIS documentation and", + "To contact the certification", + "You are required to provide", + "Following an initial review,", + "The PSC will make the final", + "If approved you are required", + "You can apply through this", + ], + }, + { + page: "QGIS Foundation", + texts: [ + "QGIS Foundation Giving the", + "Giving the power of spatial", + "Annual General Meetings Starting in 2016 (coincident with the establishment of", + "Annual Reports Starting in", + "Finance Please check the", + "QGIS.org Charter QGIS.ORG is", + ], + }, + { + page: "Charter", + texts: [ + "Charter of the QGIS.ORG Association ΒΆ Legal status of QGIS.ORG ΒΆ QGIS.ORG is", + ], + }, + { + page: "Annual General Meetings", + texts: [ + "Annual General Meetings ΒΆ Starting in 2016 (coincident with the establishment", + ], + }, + { + page: "Annual Reports", + texts: ["Annual Reports ΒΆ Starting in"], + }, + { page: "Finance", texts: ["Finance ΒΆ Please check the"] }, + { + page: "Project Organisation", + texts: ["Who’s Who ΒΆ QGIS as a Project"], + }, + { page: "Infrastructure", texts: ["Infrastructure ΒΆ This page"] }, + { + page: "Brand Guidelines", + texts: [ + "QGIS Trademark and brand guidelines ΒΆ We’re thrilled that you want to refer to", + ], + }, + { + page: "Contributor Credits", + texts: [ + "Contributor Credits ΒΆ Individuals, institutions and firms who contributed code", + ], + }, + { + page: "Committee Resolutions", + texts: [ + "Committee Resolutions Committee Resolution 2019 In 2019, the Project Steering", + "Committee Resolution 2019 In", + "Committee Resolution 2020 In", + ], + }, + { + page: "Meetings", + texts: [ + "Meetings ΒΆ Since 2009 the", + "Developer Meetings ΒΆ Go to", + "Users Meetings ΒΆ Go to", + ], + }, + { page: "Mailing Lists", texts: ["Mailing Lists ΒΆ We"] }, + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + + this.participateSupportLink = this.page.getByRole("link", { + name: "Participate in Support", + }); + this.reportBugsLink = this.page.getByRole("link", { + name: "Report Bugs", + }); + this.qgisDocumentationLink = this.page.getByRole("link", { + name: "QGIS Documentation", + }); + this.translateQGISLink = this.page.getByRole("link", { + name: "Translate QGIS", + exact: true, + }); + this.developPluginLink = this.page.getByRole("link", { + name: "Develop a Plugin", + }); + this.developQGISCoreLink = this.page.getByRole("link", { + name: "Develop QGIS Core", + }); + this.sustainDonateLink = this.page.getByRole("link", { + name: "Sustain & Donate", + }); + this.submitButton = this.page.locator("#submit-button"); + this.otherMethodsInfoLink = this.page.getByRole("link", { + name: "Other methods, more info", + }); + this.currencyInput = this.page.locator("#currency"); + this.workflowCertificationImg = this.page.getByRole("img", { + name: "Workflow Certification", + }); + this.charterLink = this.page.getByRole("link", { name: "Charter" }); + this.annualGeneralMeetingsLink = this.page.getByRole("link", { + name: "Annual General Meetings", + }); + this.annualReportsLink = this.page.getByRole("link", { + name: "Annual Reports", + }); + this.financeLink = this.page.getByRole("link", { name: "Finance" }); + this.infrastructureLink = this.page.getByRole("link", { + name: "Infrastructure", + }); + this.brandGuidelinesLink = this.page.getByRole("link", { + name: "Brand Guidelines", + }); + this.contributorCreditsLink = this.page.getByRole("link", { + name: "Contributor Credits", + }); + this.committeeResolutionsLink = this.page.getByRole("link", { + name: "Committee Resolutions", + }); + this.meetingsLink = this.page.getByRole("link", { + name: "Meetings", + exact: true, + }); + (this.goToMeetingsFirstLink = this.page + .getByRole("link", { name: "Go to meetings" }) + .first()), + (this.goToMeetingsNthLink = this.page + .getByRole("link", { name: "Go to meetings" }) + .nth(1)); + this.mailingListsLink = this.page.getByRole("link", { + name: "Mailing Lists", + }); + this.qgisUsersListLink = this.page.getByRole("link", { + name: "QGIS Users list http://lists.", + }); + this.qgisDevelopersListLink = this.page.getByRole("link", { + name: "QGIS Developers list http://", + }); + this.qgisCommunityTeamLink = this.page.getByRole("link", { + name: "QGIS Community team http://", + }); + this.qgisTranslationsLink = this.page.getByRole("link", { + name: "QGIS Translations http://", + }); + this.qgisProjectSteeringLink = this.page.getByRole("link", { + name: "QGIS Project Steering", + }); + this.qgisWebClientLink = this.page.getByRole("link", { + name: "QGIS Web Client 2 http://", + }); + } + async goto() { + await this.page.goto(this.url); + } +} diff --git a/playwright/ci-test/tests/fixtures/donate-window.ts b/playwright/ci-test/tests/fixtures/donate-window.ts new file mode 100644 index 000000000..77dc88801 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/donate-window.ts @@ -0,0 +1,26 @@ +import type { Page, Locator } from "@playwright/test"; +import { TextList } from "./interfaces"; + +export class FundingPage { + public readonly pageBody: Locator; + public readonly textList: TextList[] = [ + { + page: "Monthly", + texts: [ + "$ 5.00", + "$ 10.00", + "$ 20.00", + "$ 50.00", + "$ 100.00", + "$ 250.00", + ], + }, + { + page: "One-Time", + texts: ["$ 10.00", "$ 20.00", "$ 50.00", "$ 100.00", "$ 250.00"], + }, + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + } +} diff --git a/playwright/ci-test/tests/fixtures/download-page.ts b/playwright/ci-test/tests/fixtures/download-page.ts new file mode 100644 index 000000000..13095a2eb --- /dev/null +++ b/playwright/ci-test/tests/fixtures/download-page.ts @@ -0,0 +1,32 @@ +import type { Page, Locator } from "@playwright/test"; + +export class DownloadPage { + public readonly url: string = "/"; + public readonly beforeDownloadText: Locator; + public readonly submitButton: Locator; + public readonly otherMethodsLink: Locator; + public readonly currencyInput: Locator; + public readonly skipDownloadButton: Locator; + public readonly beforeDownloadHeading: Locator; + public readonly otherPlatformsHeading: Locator; + + constructor(public readonly page: Page) { + this.beforeDownloadText = this.page.getByText( + "Before download starts ΒΆ QGIS", + ); + this.submitButton = this.page.locator("#submit-button"); + this.otherMethodsLink = this.page.getByRole("link", { + name: "Other methods, more info", + }); + this.currencyInput = this.page.locator("#currency"); + this.skipDownloadButton = this.page.getByRole("button", { + name: "Skip it and go to download", + }); + this.beforeDownloadHeading = this.page.getByRole("heading", { + name: "Download QGIS for your", + }); + this.otherPlatformsHeading = this.page.getByRole("heading", { + name: "Other platforms", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/faq-page.ts b/playwright/ci-test/tests/fixtures/faq-page.ts new file mode 100644 index 000000000..e6c23e343 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/faq-page.ts @@ -0,0 +1,85 @@ +import type { Page, Locator } from "@playwright/test"; + +export class FaqPage { + public readonly pageBody: Locator; + public readonly textList: string[] = [ + "FAQ", + "User", + "Downloading issues", + "I have to donate in order to download QGIS", + "How to ask a QGIS question?", + "How are QGIS release names selected?", + "How to cite QGIS?", + "Cite the QGIS project in general", + "I created a map with QGIS, do I have to mention QGIS?", + "Can I open ECW files with QGIS?", + "Development", + "Can I compile QGIS myself?", + "Here we collect answers to", + "We will start of with this", + "If you are trying to download", + "This is a misconception that", + "If you are going to ask QGIS", + "Keep in mind that the more", + "Note ΒΆ In case of a broken", + "After a successful developer", + "To cite QGIS in your piece of", + "QGIS.org, %%Y. QGIS Geographic Information System. QGIS Association.", + "Cite the QGIS Developers", + "Geographic Information System Developers Manual. QGIS Association.", + "Cite the QGIS Installation", + "Geographic Information System Installation Guide. QGIS Association.", + "Geographic Information System User Guide. QGIS Association.", + "Cite the QGIS Server", + "Geographic Information System API Documentation. QGIS Association.", + "Cite the QGIS API", + "Geographic Information System API Documentation. QGIS Association.", + "Preferred format: BibTeX", + "There is no requirement to", + "Note ΒΆ Do not say Β©QGIS as", + "Yes you can… BUT depending on", + "If you are under Windows and", + "If you are using macOS, you", + "For other instructions, eg", + "Yes, compiling QGIS from", + ]; + public readonly faqLink: Locator; + public readonly qgisIssueTrackerLink: Locator; + public readonly bugReportingLink: Locator; + public readonly qgisWebsiteLink: Locator; + public readonly qgisGitHubLink: Locator; + public readonly citeQGISUserGuide: Locator; + public readonly preElements: Locator; + public readonly kyngchaosLink: Locator; + public readonly faunaliaLink: Locator; + public readonly buildingQGISFromSourceLink: Locator; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.faqLink = this.page.getByRole("link", { name: "FAQ" }); + this.qgisIssueTrackerLink = this.page.getByRole("link", { + name: "QGIS issue tracker", + }); + this.bugReportingLink = this.page.getByRole("link", { + name: "bug-reporting", + }); + this.qgisWebsiteLink = this.page.getByRole("link", { + name: "http://www.qgis.org", + }); + this.qgisGitHubLink = this.page.getByRole("link", { + name: "https://github.com/qgis/QGIS/", + }); + this.citeQGISUserGuide = this.page + .locator("p") + .filter({ hasText: "Cite the QGIS User Guide" }); + this.preElements = this.page.locator("pre"); + this.kyngchaosLink = this.page.getByRole("link", { + name: "https://www.kyngchaos.com/", + }); + this.faunaliaLink = this.page.getByRole("link", { + name: "https://www.faunalia.eu/en/", + }); + this.buildingQGISFromSourceLink = this.page.getByRole("link", { + name: "Building QGIS from source", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/footer.ts b/playwright/ci-test/tests/fixtures/footer.ts new file mode 100644 index 000000000..cabff74b7 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/footer.ts @@ -0,0 +1,129 @@ +import type { Page, Locator } from "@playwright/test"; + +export class Footer { + public readonly banner: Locator; + private readonly liElement: Locator; + public readonly productList: Locator; + public readonly communityList: Locator; + public readonly resourcesList: Locator; + public readonly fundingList: Locator; + public readonly downloadLink: Locator; + public readonly overviewLink: Locator; + public readonly caseStudiesLink: Locator; + public readonly pluginsLink: Locator; + public readonly visualChangelogsLink: Locator; + public readonly getInvolvedLink: Locator; + public readonly becomeCertifiedMemberLink: Locator; + public readonly qgisFoundationLink: Locator; + public readonly projectOrganisationLink: Locator; + public readonly localUserGroupsLink: Locator; + public readonly membersBlogsList: Locator; + public readonly qgisResourcesLink: Locator; + public readonly installationGuideLink: Locator; + public readonly documentationLink: Locator; + public readonly releasesLink: Locator; + public readonly roadmapLink: Locator; + public readonly reportsLink: Locator; + public readonly booksLink: Locator; + public readonly supportLink: Locator; + public readonly blogLink: Locator; + public readonly donateLink: Locator; + public readonly membershipList: Locator; + public readonly diversityStatementLink: Locator; + public readonly codeOfConductLink: Locator; + public readonly environmentalPolicyLink: Locator; + public readonly licenseLink: Locator; + public readonly visualStyleGuideLink: Locator; + public readonly goodiesLink: Locator; + public readonly logoImage: Locator; + public readonly facebookLink: Locator; + public readonly twitterLink: Locator; + public readonly youtubeLink: Locator; + public readonly mapstodonLink: Locator; + public readonly ghLink: Locator; + public readonly mailLink: Locator; + + constructor(public readonly page: Page) { + this.banner = this.page.getByRole("contentinfo"); + this.liElement = this.page.locator("li"); + this.productList = this.liElement.filter({ hasText: "Product" }); + this.communityList = this.liElement.filter({ hasText: "Community" }); + this.resourcesList = this.liElement.filter({ hasText: "Resources" }); + this.fundingList = this.liElement.filter({ hasText: "Funding" }); + this.downloadLink = this.banner + .locator("div") + .filter({ hasText: "Download" }) + .nth(2); + this.overviewLink = this.banner.getByRole("link", { name: "Overview" }); + this.caseStudiesLink = this.banner.getByRole("link", { + name: "Case studies", + }); + this.pluginsLink = this.banner.getByRole("link", { name: "Plugins" }); + this.visualChangelogsLink = this.banner.getByRole("link", { + name: "Visual Changelogs", + }); + this.getInvolvedLink = this.banner.getByRole("link", { + name: "Get involved", + }); + this.becomeCertifiedMemberLink = this.page.getByRole("link", { + name: "Become a certified member", + exact: true, + }); + this.qgisFoundationLink = this.banner.getByRole("link", { + name: "QGIS Foundation", + }); + this.projectOrganisationLink = this.banner.getByRole("link", { + name: "Project Organisation", + }); + this.localUserGroupsLink = this.banner.getByRole("link", { + name: "Local User Groups", + }); + this.membersBlogsList = this.liElement.filter({ + hasText: "Members Blogs", + }); + this.qgisResourcesLink = this.page.getByRole("link", { + name: "QGIS resources", + exact: true, + }); + this.installationGuideLink = this.liElement.filter({ + hasText: "Installation guide", + }); + this.documentationLink = this.banner.getByRole("link", { + name: "Documentation", + }); + this.releasesLink = this.banner.getByRole("link", { name: "Releases" }); + this.roadmapLink = this.banner.getByRole("link", { name: "Roadmap" }); + this.reportsLink = this.banner.getByRole("link", { name: "Reports" }); + this.booksLink = this.banner.getByRole("link", { name: "Books" }); + this.supportLink = this.banner.getByRole("link", { name: "Support" }); + this.blogLink = this.banner.getByRole("link", { + name: "Blog", + exact: true, + }); + this.donateLink = this.banner.getByRole("link", { name: "Donate" }); + this.membershipList = this.liElement.filter({ hasText: "Membership" }); + this.diversityStatementLink = this.page.getByRole("link", { + name: "Diversity statement", + }); + this.codeOfConductLink = this.page.getByRole("link", { + name: "Code of conduct", + }); + this.environmentalPolicyLink = this.page.getByRole("link", { + name: "Environmental policy", + }); + this.licenseLink = this.page.getByRole("link", { name: "License" }); + this.visualStyleGuideLink = this.page.getByRole("link", { + name: "Visual Style Guide", + }); + this.goodiesLink = this.page.getByRole("link", { name: "Goodies" }); + this.logoImage = this.page.getByRole("img", { name: "Logo" }); + this.facebookLink = this.page.getByRole("link", { name: "ο‚‚" }); + this.twitterLink = this.page.getByRole("link", { name: "" }); + this.youtubeLink = this.page.getByRole("link", { name: "ο…§" }); + this.mapstodonLink = this.page + .locator("div:nth-child(2) > div:nth-child(2) > a:nth-child(4)") + .first(); + this.ghLink = this.page.getByRole("link", { name: "ο‚’" }); + this.mailLink = this.page.getByRole("link", { name: "οƒ " }); + } +} diff --git a/playwright/ci-test/tests/fixtures/funding-page.ts b/playwright/ci-test/tests/fixtures/funding-page.ts new file mode 100644 index 000000000..deec86fb3 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/funding-page.ts @@ -0,0 +1,119 @@ +import type { Page, Locator } from "@playwright/test"; +import { TextList } from "./interfaces"; + +export class FundingPage { + public readonly url: string = "/funding/donate/"; + public readonly pageBody: Locator; + public readonly submitButton: Locator; + public readonly currencyInput: Locator; + public readonly donateButton: Locator; + public readonly becomeSustainingMemberLink: Locator; + public readonly sustainingMembershipDiv: Locator; + public readonly sustainingMembershipSection: Locator; + public readonly writeTrearurerLink: Locator; + public readonly openSustainingMembersLink: Locator; + public readonly textList: TextList[] = [ + { + page: "Donate", + texts: [ + "QGIS is developed by a team", + "We rely on sponsorships and", + "Donations to QGIS are tax-", + "We use the stripe", + "Bank transfer ΒΆ Use the", + "Account name: QGIS.ORG", + "You can use Paypal", + ], + }, + { + page: "Membership", + texts: [ + "Sustaining Membership program ΒΆ QGIS is an entirely Open Source project. QGIS", + "QGIS is an entirely Open", + "As a result, you have free", + "€ 27,000+ ΒΆ Flagship Member (", + "€ 9,000+ ΒΆ Large Member (e.g", + "€ 3,000+ ΒΆ Medium Member (e.g", + "€ 500+ ΒΆ Small Member (e.g.", + "Public Acknowledgment ΒΆ All", + "Enhanced Software Quality ΒΆ Your contribution aids in resolving bugs and issues", + "Enhanced Brand Exposure ΒΆ Flagship, large and medium sustaining members will", + "Featured in Software Updates ΒΆ Your support is highlighted in the visual", + "Public Acknowledgment ΒΆ Use a", + "Enhanced Brand Exposure ΒΆ Enjoy an ad-free experience in QGIS, focusing on your", + "Reach out to the treasurer at", + "The treasurer will gather", + "The treasurer verifies the", + "Membership details are", + "Recognition: Sustaining", + "Visibility: Members are", + "Promotion: When appropriate,", + "Past sustaining members are", + "You can also make one-time payement ΒΆ Donations can be of any amount, via", + "About β€˜earmarked’ funding ΒΆ We regret that we cannot accept β€˜earmarked’ funding", + "Warning ΒΆ Acceptance of", + ], + }, + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.submitButton = this.page.locator("#submit-button"); + this.currencyInput = this.page.locator("#currency"); + this.donateButton = this.page.getByRole("button", { name: "Donate" }); + this.becomeSustainingMemberLink = this.page.getByRole("link", { + name: "Become a Sustaining Member", + }); + this.sustainingMembershipDiv = this.page + .locator("div") + .filter({ + hasText: + "Sustaining Membership program Join our mission to enhance and promote QGIS as", + }) + .nth(1); + this.sustainingMembershipSection = this.page + .locator("section") + .filter({ + hasText: + "Sustaining Membership program Join our mission to enhance and promote QGIS as", + }) + .getByRole("link"); + this.writeTrearurerLink = this.page.getByRole("link", { + name: "Write to trearurer", + }); + this.openSustainingMembersLink = this.page.getByRole("link", { + name: "Open Sustaining Members", + }); + } + async goto() { + await this.page.goto(this.url); + } +} + +export class MembersPage { + public readonly flagshipHeading: Locator; + public readonly flagshipArticle: Locator; + public readonly largeHeading: Locator; + public readonly largeArticle: Locator; + + constructor(public readonly page: Page) { + this.flagshipHeading = this.page.getByRole("heading", { + name: "Flagship", + }); + this.flagshipArticle = this.page + .locator("article") + .filter({ hasText: "Felt" }); + this.largeHeading = this.page.getByRole("heading", { name: "Large" }); + this.largeArticle = this.page + .locator("article") + .filter({ hasText: "Land Vorarlberg" }); + } +} + +export class PastMembersPage { + public readonly pageBody: Locator; + public readonly textList: string[] = ["Past sustaining members"]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + } +} diff --git a/playwright/ci-test/tests/fixtures/header.ts b/playwright/ci-test/tests/fixtures/header.ts new file mode 100644 index 000000000..387cd66b3 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/header.ts @@ -0,0 +1,101 @@ +import type { Page, Locator } from "@playwright/test"; + +export class Header { + public readonly banner: Locator; + public readonly mainNavigation: Locator; + public readonly logoLink: Locator; + public readonly productLink: Locator; + public readonly overviewLink: Locator; + public readonly caseStudiesLink: Locator; + public readonly pluginsLink: Locator; + public readonly visualChangelogLink: Locator; + public readonly communityLink: Locator; + public readonly getInvolvedLink: Locator; + public readonly certifiedMemberLink: Locator; + public readonly qgisFoundationLink: Locator; + public readonly projectOrganisationLink: Locator; + public readonly membersBlogLink: Locator; + public readonly downloadLink: Locator; + public readonly resourcesLink: Locator; + public readonly qgisResourcesLink: Locator; + public readonly installationGuideLink: Locator; + public readonly documentationLink: Locator; + public readonly releasesLink: Locator; + public readonly roadmapLink: Locator; + public readonly reportsLink: Locator; + public readonly booksLink: Locator; + public readonly supportLink: Locator; + public readonly blogLink: Locator; + public readonly donateLink: Locator; + public readonly searchInput: Locator; + + constructor(public readonly page: Page) { + this.banner = this.page.getByRole("banner"); + this.mainNavigation = this.page.getByLabel("main navigation"); + this.logoLink = this.mainNavigation.getByRole("link").first(); + this.productLink = this.mainNavigation.getByText("Product"); + this.overviewLink = this.mainNavigation.getByRole("link", { + name: "Overview", + }); + this.caseStudiesLink = this.mainNavigation.getByRole("link", { + name: "Case studies", + }); + this.pluginsLink = this.mainNavigation.getByRole("link", { + name: "Plugins", + }); + this.visualChangelogLink = this.mainNavigation.getByRole("link", { + name: "Visual Changelogs", + }); + this.communityLink = this.mainNavigation.getByText("Community"); + this.getInvolvedLink = this.mainNavigation.getByRole("link", { + name: "Get involved", + }); + this.certifiedMemberLink = this.mainNavigation.getByRole("link", { + name: "Become a Certified Member", + }); + this.qgisFoundationLink = this.mainNavigation.getByRole("link", { + name: "QGIS Foundation", + }); + this.projectOrganisationLink = this.mainNavigation.getByRole("link", { + name: "Project Organisation", + }); + this.membersBlogLink = this.mainNavigation.getByRole("link", { + name: "Members Blog", + }); + this.downloadLink = this.mainNavigation.getByRole("link", { + name: "Download", + }); + this.resourcesLink = this.mainNavigation.getByText("Resources", { + exact: true, + }); + this.qgisResourcesLink = this.mainNavigation.getByRole("link", { + name: "QGIS Resources", + }); + this.installationGuideLink = this.mainNavigation.getByRole("link", { + name: "Installation Guide", + }); + this.documentationLink = this.mainNavigation.getByRole("link", { + name: "Documentation", + }); + this.releasesLink = this.mainNavigation.getByRole("link", { + name: "Releases", + }); + this.roadmapLink = this.mainNavigation.getByRole("link", { + name: "Roadmap", + }); + this.reportsLink = this.mainNavigation.getByRole("link", { + name: "Reports", + }); + this.booksLink = this.mainNavigation.getByRole("link", { + name: "Books", + }); + this.supportLink = this.mainNavigation.getByRole("link", { + name: "Support", + }); + this.blogLink = this.mainNavigation.getByRole("link", { name: "Blog" }); + this.donateLink = this.mainNavigation.getByRole("link", { + name: "Donate", + }); + this.searchInput = this.page.getByPlaceholder("Search"); + } +} diff --git a/playwright/ci-test/tests/fixtures/home-page.ts b/playwright/ci-test/tests/fixtures/home-page.ts new file mode 100644 index 000000000..aa5bdd801 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/home-page.ts @@ -0,0 +1,157 @@ +import type { Page, Locator, expect } from "@playwright/test"; + +export class HomePage { + private readonly url: string = "/"; + public readonly pageBody: Locator; + public readonly freeOpenSourceSpatialDiv: Locator; + public readonly downloadLink: Locator; + public readonly spatialWithoutCompromiseHeading: Locator; + public readonly createMapsHeading: Locator; + public readonly editLayersHeading: Locator; + public readonly processAndAnalyzeHeading: Locator; + public readonly shareMapsHeading: Locator; + public readonly exploreQGISLink: Locator; + public readonly powerOfOpenSourceHeading: Locator; + public readonly getInvolvedLink: Locator; + public readonly freeAndOpenSourceHeading: Locator; + public readonly freeDownloadLink: Locator; + public readonly youTubeVideoThumbnailOverlayImage: Locator; + public readonly startUsingQGISHeading: Locator; + public readonly goToMaterialsLink: Locator; + public readonly qgisSupportersHeading: Locator; + public readonly supportersGridDiv: Locator; + public readonly addYourLogoHereText: Locator; + public readonly silverPartnerText: Locator; + public readonly createMapsImg: Locator; + public readonly editLayersImg: Locator; + public readonly processImg: Locator; + public readonly shareMapsImg: Locator; + public readonly communityImg: Locator; + public readonly changeLogVideo: Locator; + public readonly otherSupporters: Locator; + + public readonly textList: string[] = [ + "Free and open source", + "Giving the power of spatial", + "Available on Windows, Mac,", + "Explore QGIS's exceptional", + "Class-leading cartography", + "Experience QGIS' extensive", + "Professional map production", + "Use the intuitive layout", + "Powerful reporting tools", + "Create atlasses and reports", + "Harness the unmatched", + "Exceptional digitizing", + "Craft and edit points, lines", + "Advanced construction tools", + "Build geometries with curves", + "Highly customizable forms", + "Create user-friendly forms", + "Benefit from state-of-the art", + "Comprehensive analysis toolset", + "Uncover insights from your", + "Automated analysis workflows", + "Visually combine analysis", + "Extensible analysis", + "Explore a diverse ecosystem", + "QGIS provides an equal", + "Industry-leading format", + "Conquer data integration", + "Standards and interoperability", + "Amplify your impact by", + "Publish your work", + "Extend QGIS to the cloud and", + "Our community development", + "Join our annual international", + "Find local user groups and", + "Learn how people around the", + "QGIS is a public project", + "For that reason QGIS is Free", + "Quick-start tutorials", + "Live demos", + "Up-to-date documentation", + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.freeOpenSourceSpatialDiv = this.page + .locator("div") + .filter({ hasText: "Free and open source Spatial" }) + .first(); + this.downloadLink = this.page + .locator("section") + .filter({ hasText: "Free and open source Spatial" }) + .getByRole("link"); + this.spatialWithoutCompromiseHeading = this.page.getByRole("heading", { + name: "Spatial without compromise", + }); + this.createMapsHeading = this.page.getByRole("heading", { + name: "Create maps", + }); + this.editLayersHeading = this.page.getByRole("heading", { + name: "Edit layers", + }); + this.processAndAnalyzeHeading = this.page.getByRole("heading", { + name: "Process and analyze", + }); + this.shareMapsHeading = this.page.getByRole("heading", { + name: "Share maps", + }); + this.exploreQGISLink = this.page.getByRole("link", { + name: "Explore QGIS", + }); + this.powerOfOpenSourceHeading = this.page.getByRole("heading", { + name: "πŸ‘‹ The power of open source", + }); + this.getInvolvedLink = this.page + .getByRole("link", { name: "Get involved" }) + .first(); + this.freeAndOpenSourceHeading = this.page.getByRole("heading", { + name: "Free and open source", + }); + this.freeDownloadLink = this.page.getByRole("link", { + name: "Free download", + }); + this.youTubeVideoThumbnailOverlayImage = this.page + .frameLocator('iframe[title="YouTube video player"]') + .locator(".ytp-cued-thumbnail-overlay-image"); + this.startUsingQGISHeading = this.page.getByRole("heading", { + name: "Start using QGIS πŸš€", + }); + this.goToMaterialsLink = this.page.getByRole("link", { + name: "Go to materials", + }); + this.qgisSupportersHeading = this.page.getByRole("heading", { + name: "QGIS supporters", + }); + this.addYourLogoHereText = this.page + .locator("div") + .filter({ hasText: "Add your logo here?" }) + .nth(2); + this.silverPartnerText = this.page + .locator("div") + .filter({ hasText: "Silver partner" }) + .nth(2); + this.supportersGridDiv = this.page + .locator(".supporters-grid > div:nth-child(3)") + .first(); + this.createMapsImg = this.page.locator(".deco-block-1 > img"); + this.editLayersImg = this.page.locator(".deco-block-2 > img"); + this.processImg = this.page.locator(".deco-block-3 > img"); + this.shareMapsImg = this.page.locator(".deco-block-4 > img"); + this.communityImg = this.page.locator( + ".explore > .columns > div > figure > img", + ); + this.changeLogVideo = this.page + .frameLocator('iframe[title="YouTube video player"]') + .locator(".ytp-cued-thumbnail-overlay-image"); + this.otherSupporters = this.page + .locator(".container > div:nth-child(3)") + .first(); + } + + async goto() { + await this.page.goto(this.url); + } +} diff --git a/playwright/ci-test/tests/fixtures/installation-guide-page.ts b/playwright/ci-test/tests/fixtures/installation-guide-page.ts new file mode 100644 index 000000000..691b6b364 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/installation-guide-page.ts @@ -0,0 +1,384 @@ +import type { Page, Locator } from "@playwright/test"; + +export class InstallationGuidePage { + public readonly pageBody: Locator; + public readonly upcomingEvaluationLink: Locator; + public readonly releaseScheduleLink: Locator; + public readonly releaseCell1: Locator; + public readonly releaseVersionPackageCell: Locator; + public readonly packageCell: Locator; + public readonly mainInstallersPageLink: Locator; + public readonly osgeo4WInstallerLink: Locator; + public readonly aptInstallGnupgPre: Locator; + public readonly aptInstallAptPre: Locator; + public readonly aptUpdatePre: Locator; + public readonly aptInstallQgisPre: Locator; + public readonly ubuntugisLink: Locator; + public readonly ubuntugisDocumentationLink: Locator; + public readonly releaseCell4: Locator; + public readonly releaseVersionDescriptionCell: Locator; + public readonly descriptionCell: Locator; + public readonly repositoryCell: Locator; + public readonly latestReleaseCell: Locator; + public readonly releaseWithUbuntugisCell: Locator; + public readonly releaseDebianUbuntuCell: Locator; + public readonly releaseDebianUbuntuLink: Locator; + public readonly releaseUbuntugisCell: Locator; + public readonly longTermReleaseRepositoryCell: Locator; + public readonly releaseDebianUbuntuCell2: Locator; + public readonly releaseDebianLtrLink: Locator; + public readonly releaseWithUbuntugisCell2: Locator; + public readonly distributionCell: Locator; + public readonly distributionVersionCodenameCell: Locator; + public readonly codenameCell: Locator; + public readonly alsoAvailableBasedOnCell: Locator; + public readonly wgetQgisPre: Locator; + public readonly qgisArchiveKeyringPre: Locator; + public readonly mkdirAptPre1: Locator; + public readonly mkdirAptPre2: Locator; + public readonly aptUpdateInstallQgisPre: Locator; + public readonly aptUpdateInstallQgisServerPre: Locator; + public readonly dnfInstallQgisPre: Locator; + public readonly dnfCoprEnableQgisPre1: Locator; + public readonly dnfInstallQgisPythonPre: Locator; + public readonly dnfInstallQgisServerPre: Locator; + public readonly distributionCell2: Locator; + public readonly distGrassFedora: Locator; + public readonly qgisVersionCell: Locator; + public readonly grassGisVersionCell: Locator; + public readonly dnfCoprEnableQgisPre2: Locator; + public readonly dnfInstallQgisPythonPre2: Locator; + public readonly dnfInstallQgisServerPre2: Locator; + public readonly fedoraCoprLink: Locator; + public readonly distributionCell3: Locator; + public readonly repositoryCell2: Locator; + public readonly urpmiQgisPre: Locator; + public readonly pacmanQgisPre: Locator; + public readonly yaourtQgisLtrPre: Locator; + public readonly flatpakInstallPre: Locator; + public readonly flatpakRunPre: Locator; + public readonly flatpakUpdatePre: Locator; + public readonly spackInstallQgisPre: Locator; + public readonly spackLoadQgisPre: Locator; + public readonly spackEnvCreatePre: Locator; + public readonly portInfoQgis3Pre: Locator; + public readonly portInstallQgis3Pre: Locator; + public readonly portSelfupdatePre: Locator; + public readonly pkgInstallQgisPre: Locator; + public readonly makeInstallQgisPre: Locator; + public readonly pkgInstallQgisLtrSpan: Locator; + public readonly makeInstallQgisLtrPre: Locator; + public readonly pkgAddQgisPre: Locator; + public readonly googlePlayLink: Locator; + public readonly textList: string[] = [ + "QGIS Installers ΒΆ How to", + "How to obtain QGIS?", + "QGIS is available on Windows", + "We recommend installing the", + "To evaluate the upcoming", + "In the feature frozen phase", + "There are two options for", + "For beginners the easiest way", + "More advanced QGIS users", + "The OSGeo4W repository", + "Download OSGeo4W Installer", + "Choose Express Install and", + "The packages listed in the", + "Most linux distributions", + "Below you find instructions", + "Note ΒΆ In the section", + "Note ΒΆ Although you see β€˜", + "Note ΒΆ Suites in above lines", + "Note ΒΆ Add qgis-server to", + "To have newer versions, you", + "Our main repository contains", + "For Ubuntu we also used to", + "Note ΒΆ The release packages", + "Note ΒΆ Please remove all the", + "More information are", + "More information are", + "Packages on https://", + "Arch Linux is available in", + "yaourt -S qgis-git", + "For bugs and other behaviour", + "For general Linux Flatpak", + "QGIS on Flathub: https://", + "Flathub files: https://github", + "General info on installing", + "QGIS package file on Spack:", + "Spack related issues should", + "Official All-in-one, signed", + "The package management system", + "Installing MacPorts and updating it and the ports are made with the Terminal.", + "Note ΒΆ Concurrent", + "Previous releases of the official installer can be downloaded from https://qgis", + "Previous releases of the kyngchaos installer can be downloaded from https://www", + "See: - https://openbsd.app/?", + "An old and deprecated not", + "Warning ΒΆ There is currently", + "Warning ΒΆ QGIS testing", + "Refer to INSTALL on how to", + "QGIS Installers", + "Windows", + "Standalone installers", + "OSGeo4W installer", + "Linux", + "Debian/Ubuntu", + "Repositories", + "Supported distribution versions:", + "Fedora", + "QGIS stable", + "QGIS LTR (Long Term Release)", + "SUSE / openSUSE", + "Mandriva", + "Slackware", + "Arch Linux", + "QGIS LTR", + "QGIS testing", + "Flatpak", + "Spack", + "Mac OS X / macOS", + "QGIS nightly release", + "MacPorts", + "Old releases", + "FreeBSD", + "QGIS stable", + "QGIS LTR", + "OpenBSD", + "Android", + "QGIS Testing warning", + "Installing from Source", + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.upcomingEvaluationLink = this.page + .locator("p") + .filter({ hasText: "To evaluate the upcoming" }) + .getByRole("link"); + this.releaseScheduleLink = this.page.getByRole("link", { + name: "Release schedule", + }); + this.releaseCell1 = this.page + .getByRole("cell", { name: "Release", exact: true }) + .first(); + this.releaseVersionPackageCell = this.page + .getByRole("row", { name: "Release Version Package", exact: true }) + .getByRole("cell") + .nth(1); + this.packageCell = this.page + .getByRole("cell", { name: "Package" }) + .first(); + this.mainInstallersPageLink = this.page.getByRole("link", { + name: "The main installers page", + }); + this.osgeo4WInstallerLink = this.page.getByRole("link", { + name: "OSGeo4W Installer", + }); + this.aptInstallGnupgPre = this.page + .locator("pre") + .filter({ hasText: "sudo apt install gnupg" }); + this.aptInstallAptPre = this.page + .locator("pre") + .filter({ hasText: "sudo mkdir -m755 -p /etc/apt/" }) + .first(); + this.aptUpdatePre = this.page + .locator("pre") + .filter({ hasText: "sudo apt update" }) + .first(); + this.aptInstallQgisPre = this.page + .locator("pre") + .filter({ hasText: "sudo apt install qgis qgis-" }) + .first(); + this.ubuntugisLink = this.page.getByRole("link", { + name: "ubuntugis", + exact: true, + }); + this.ubuntugisDocumentationLink = this.page.getByRole("link", { + name: "ubuntugis documentation", + }); + this.releaseCell4 = this.page + .getByRole("cell", { name: "Release", exact: true }) + .nth(4); + this.releaseVersionDescriptionCell = this.page + .getByRole("row", { name: "Release Version Description" }) + .getByRole("cell") + .nth(1); + this.descriptionCell = this.page + .getByRole("cell", { name: "Description" }) + .nth(1); + this.repositoryCell = this.page + .getByRole("cell", { name: "Repository" }) + .first(); + this.latestReleaseCell = this.page + .getByRole("cell", { name: "Latest Release" }) + .nth(2); + this.releaseWithUbuntugisCell = this.page + .getByRole("cell", { name: "Release with ubuntugis-" }) + .first(); + this.releaseDebianUbuntuCell = this.page + .getByRole("cell", { name: "Release for Debian and Ubuntu" }) + .first(); + this.releaseDebianUbuntuLink = this.page.getByRole("link", { + name: "https://qgis.org/debian", + exact: true, + }); + this.releaseUbuntugisCell = this.page + .getByRole("cell", { name: "Release with ubuntugis-" }) + .nth(2); + this.longTermReleaseRepositoryCell = this.page.getByRole("cell", { + name: "Long Term Release Repository", + }); + this.releaseDebianUbuntuCell2 = this.page + .getByRole("cell", { name: "Release for Debian and Ubuntu" }) + .nth(2); + this.releaseDebianLtrLink = this.page.getByRole("link", { + name: "https://qgis.org/debian-ltr", + }); + this.releaseWithUbuntugisCell2 = this.page + .getByRole("cell", { name: "Release with ubuntugis-" }) + .nth(2); + this.distributionCell = this.page + .getByRole("cell", { name: "Distribution" }) + .first(); + this.distributionVersionCodenameCell = this.page + .getByRole("row", { name: "Distribution Version Codename" }) + .getByRole("cell") + .nth(1); + this.codenameCell = this.page.getByRole("cell", { name: "Codename" }); + this.alsoAvailableBasedOnCell = this.page.getByRole("cell", { + name: "Also available based on", + }); + this.wgetQgisPre = this.page + .locator("pre") + .filter({ hasText: "wget https://download.qgis." }); + this.qgisArchiveKeyringPre = this.page.locator("pre").filter({ + hasText: + "./qgis-archive-keyring.gpg -------------------------- pub rsa4096 2022-08-08 [", + }); + this.mkdirAptPre1 = this.page + .locator("pre") + .filter({ hasText: "sudo mkdir -m755 -p /etc/apt/" }) + .nth(1); + this.mkdirAptPre2 = this.page + .locator("pre") + .filter({ hasText: "sudo mkdir -m755 -p /etc/apt/" }) + .nth(2); + this.aptUpdateInstallQgisPre = this.page.locator("pre").filter({ + hasText: "sudo apt update sudo apt install qgis qgis-plugin-grass", + }); + this.aptUpdateInstallQgisServerPre = this.page.locator("pre").filter({ + hasText: + "sudo apt update sudo apt install qgis-server --no-install-recommends --no-", + }); + this.dnfInstallQgisPre = this.page.locator("pre").filter({ + hasText: + "sudo dnf install qgis python3-qgis qgis-grass qgis-server", + }); + this.dnfCoprEnableQgisPre1 = this.page + .locator("pre") + .filter({ hasText: "sudo dnf copr enable dani/qgis" }) + .first(); + this.dnfInstallQgisPythonPre = this.page + .locator("pre") + .filter({ hasText: "sudo dnf install qgis python3" }) + .nth(1); + this.dnfInstallQgisServerPre = this.page + .locator("pre") + .filter({ hasText: "sudo dnf install qgis-server" }) + .first(); + this.distributionCell2 = this.page + .getByRole("cell", { name: "Distribution" }) + .nth(1); + this.distGrassFedora = this.page + .locator("table") + .filter({ + hasText: + "Distribution Version QGIS version GRASS GIS version Fedora", + }) + .locator("th") + .nth(1); + this.qgisVersionCell = this.page + .getByRole("cell", { name: "QGIS version" }) + .first(); + this.grassGisVersionCell = this.page + .getByRole("cell", { name: "GRASS GIS version" }) + .first(); + this.dnfCoprEnableQgisPre2 = this.page + .locator("pre") + .filter({ hasText: "sudo dnf copr enable dani/qgis-ltr" }); + this.dnfInstallQgisPythonPre2 = this.page + .locator("pre") + .filter({ hasText: "sudo dnf install qgis python3" }) + .nth(2); + this.dnfInstallQgisServerPre2 = this.page + .locator("pre") + .filter({ hasText: "sudo dnf install qgis-server" }) + .nth(1); + this.fedoraCoprLink = this.page.getByRole("link", { + name: "https://copr.fedorainfracloud.org/coprs/dani/qgis-ltr/", + }); + this.distributionCell3 = this.page + .getByRole("cell", { name: "Distribution" }) + .nth(2); + this.repositoryCell2 = this.page + .getByRole("cell", { name: "Repository" }) + .nth(2); + this.urpmiQgisPre = this.page + .locator("pre") + .filter({ hasText: "urpmi qgis-python qgis-grass" }); + this.pacmanQgisPre = this.page + .locator("pre") + .filter({ hasText: "pacman -S qgis" }); + this.yaourtQgisLtrPre = this.page + .locator("pre") + .filter({ hasText: "yaourt -S qgis-ltr" }); + this.flatpakInstallPre = this.page + .locator("pre") + .filter({ hasText: "flatpak install --from https" }); + this.flatpakRunPre = this.page + .locator("pre") + .filter({ hasText: "flatpak run org.qgis.qgis" }); + this.flatpakUpdatePre = this.page + .locator("pre") + .filter({ hasText: "flatpak update" }); + this.spackInstallQgisPre = this.page + .locator("pre") + .filter({ hasText: "spack install qgis" }); + this.spackLoadQgisPre = this.page + .locator("pre") + .filter({ hasText: "spack load qgis" }); + this.spackEnvCreatePre = this.page + .locator("pre") + .filter({ hasText: "spack env create myenv spack" }); + this.portInfoQgis3Pre = this.page + .locator("pre") + .filter({ hasText: "sudo port info qgis3" }); + this.portInstallQgis3Pre = this.page + .locator("pre") + .filter({ hasText: "sudo port install qgis3 +grass" }); + this.portSelfupdatePre = this.page + .locator("pre") + .filter({ hasText: "sudo port selfupdate sudo" }); + this.pkgInstallQgisPre = this.page + .locator("pre") + .filter({ hasText: "pkg install qgis" }) + .first(); + this.makeInstallQgisPre = this.page.locator("pre").filter({ + hasText: "cd /usr/ports/graphics/qgis make install clean", + }); + this.pkgInstallQgisLtrSpan = this.page + .locator("span") + .filter({ hasText: "pkg install qgis-ltr" }) + .first(); + this.makeInstallQgisLtrPre = this.page + .locator("pre") + .filter({ hasText: "cd /usr/ports/graphics/qgis-" }); + this.pkgAddQgisPre = this.page + .locator("pre") + .filter({ hasText: "pkg_add qgis" }); + this.googlePlayLink = this.page.getByRole("link", { + name: "https://play.google.com/store", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/interfaces.ts b/playwright/ci-test/tests/fixtures/interfaces.ts new file mode 100644 index 000000000..ced401a42 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/interfaces.ts @@ -0,0 +1,4 @@ +export interface TextList { + page: string; + texts: string[]; +} diff --git a/playwright/ci-test/tests/fixtures/product-page.ts b/playwright/ci-test/tests/fixtures/product-page.ts new file mode 100644 index 000000000..4160636f1 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/product-page.ts @@ -0,0 +1,110 @@ +import type { Page, Locator } from "@playwright/test"; + +export class ProductPage { + public readonly pageBody: Locator; + public readonly qgisOverview: Locator; + public readonly fosQGISLink: Locator; + public readonly contentTab1Img: Locator; + public readonly createMapImg: Locator; + public readonly goToPluginsLink: Locator; + public readonly internationalConferenceImg: Locator; + public readonly communityMeetingsLink: Locator; + public readonly localUserGroupsImg: Locator; + public readonly localUserGroupsHeading: Locator; + public readonly localGroupsListLink: Locator; + public readonly joinTheCommunityLink: Locator; + public readonly amurumForestLink: Locator; + public readonly mapsLink: Locator; + public readonly screenshotsLink: Locator; + public readonly caseStudiesAmurumLink: Locator; + public readonly productTextList: string[] = [ + "Free and open source", + "Giving the power of spatial", + "Available on Windows, Mac,", + "Key features ΒΆ Create map", + "Create map", + "Edit layers", + "Process and analyze", + "Share maps", + "Class-leading cartography ΒΆ Experience QGIS’ extensive set of design options to", + "Enhance the functionality of", + "Connect with professionals,", + "Join a community of like-", + "QGIS Server ΒΆ Publish your", + "QGIS Desktop ΒΆ Create, edit,", + "QGIS Web Client ΒΆ Publish", + "QGIS on mobiles and tablets ΒΆ The QGIS experience does not stop on the desktop", + "Case Studies ΒΆ We gather", + "Maps showcase ΒΆ QGIS users", + "Application screenshots ΒΆ Below are some screenshots from QGIS itself and a", + ]; + + public readonly mapsTextList: string[] = [ + "QGIS Maps ΒΆ Amazing maps", + "Amazing maps created using", + ]; + + public readonly screenshotsTextList: string[] = [ + "QGIS Screenshots ΒΆ Screenshots of QGIS in action", + "Screenshots of QGIS in action", + ]; + + public readonly caseStudiesTextList: string[] = [ + "Case Studies ΒΆ Amurum forest", + ]; + + public readonly visualChangelogsTextList: string[] = [ + "Visual Changelogs ΒΆ Below you", + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.qgisOverview = this.page.getByRole("heading", { + name: "QGIS overview", + }); + this.fosQGISLink = this.page + .locator("section") + .filter({ hasText: "Free and open source QGIS" }) + .getByRole("link"); + this.contentTab1Img = this.page + .locator("#content-tab-1") + .getByRole("img", { name: "Create map" }); + this.createMapImg = this.page + .getByRole("img", { name: "Create map" }) + .nth(1); + this.goToPluginsLink = this.page.getByRole("link", { + name: "Go to plugins", + }); + this.internationalConferenceImg = this.page.getByRole("img", { + name: "International conference", + }); + this.communityMeetingsLink = this.page.getByRole("link", { + name: "Community meetings", + }); + this.localUserGroupsImg = this.page.getByRole("img", { + name: "Local user groups", + }); + this.localUserGroupsHeading = this.page.getByRole("heading", { + name: "Local user groups and support", + }); + this.localGroupsListLink = this.page.getByRole("link", { + name: "Local groups list", + }); + this.joinTheCommunityLink = this.page.getByRole("link", { + name: "Join the community", + }); + this.amurumForestLink = this.page.getByRole("link", { + name: "Amurum forest reserve habitat", + }); + this.mapsLink = this.page.getByRole("link", { + name: "Maps", + exact: true, + }); + this.screenshotsLink = this.page.getByRole("link", { + name: "Screenshots", + }); + this.caseStudiesAmurumLink = this.page.getByRole("link", { + name: "Amurum forest reserve habitat", + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/qgis-resources-page.ts b/playwright/ci-test/tests/fixtures/qgis-resources-page.ts new file mode 100644 index 000000000..309c88524 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/qgis-resources-page.ts @@ -0,0 +1,88 @@ +import type { Page, Locator } from "@playwright/test"; + +export class QgisResourcesPage { + private readonly url: string = "/resources/hub/"; + public readonly pageBody: Locator; + public readonly installationGuideLink: Locator; + public readonly getInvolvedLink: Locator; + public readonly tab3Element: Locator; + public readonly desktopUserGuideLink: Locator; + public readonly serverGuideLink: Locator; + public readonly qgisTrainingManualLink: Locator; + public readonly introductionInGISLink: Locator; + public readonly documentationGuidelinesLink: Locator; + public readonly pyQGISCookbookLink: Locator; + public readonly cPlusPlusAPIDocumentationLink: Locator; + public readonly pyQGISApiLink: Locator; + public readonly buildingQGISFromSourceLink: Locator; + public readonly forDownloadParagraph: Locator; + public readonly pdfManualsLink: Locator; + public readonly htmlZipManualsLink: Locator; + public readonly viewSupportOptionsLink: Locator; + public readonly textList: string[] = [ + "Resources ΒΆ πŸ–– Troubles with", + "Troubles with installation? ΒΆ If you are looking for information on installing", + "QGIS has a lot of", + "You will find documentation", + "Get involved and help us", + "Archived releases", + "For documentation writers", + "For developers", + "Support ΒΆ The QGIS community", + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.installationGuideLink = this.page + .locator("a") + .filter({ hasText: /^Installation guide$/ }); + this.getInvolvedLink = this.page + .locator("p") + .filter({ hasText: "Get involved and help us" }) + .getByRole("link"); + this.tab3Element = this.page.locator("#tab-3"); + this.desktopUserGuideLink = this.page.getByRole("link", { + name: "Desktop User Guide/Manual", + }); + this.serverGuideLink = this.page.getByRole("link", { + name: "Server Guide/Manual", + }); + this.qgisTrainingManualLink = this.page.getByRole("link", { + name: "QGIS Training manual", + }); + this.introductionInGISLink = this.page.getByRole("link", { + name: "Introduction in GIS", + }); + this.documentationGuidelinesLink = this.page.getByRole("link", { + name: "Documentation Guidelines", + }); + this.pyQGISCookbookLink = this.page.getByRole("link", { + name: "PyQGIS cookbook (for plugins", + }); + this.cPlusPlusAPIDocumentationLink = this.page.getByRole("link", { + name: "C++ API documentation", + }); + this.pyQGISApiLink = this.page.getByRole("link", { + name: "PyQGIS - QGIS Python Api", + }); + this.buildingQGISFromSourceLink = this.page.getByRole("link", { + name: "Building QGIS from Source", + }); + this.forDownloadParagraph = this.page + .locator("p") + .filter({ hasText: "For download" }) + .first(); + this.pdfManualsLink = this.page.getByRole("link", { + name: "PDF of the manuals", + }); + this.htmlZipManualsLink = this.page.getByRole("link", { + name: "HTML zip of the manuals", + }); + this.viewSupportOptionsLink = this.page.getByRole("link", { + name: "View support options", + }); + } + async goto() { + await this.page.goto(this.url); + } +} diff --git a/playwright/ci-test/tests/fixtures/releases-page.ts b/playwright/ci-test/tests/fixtures/releases-page.ts new file mode 100644 index 000000000..986441d08 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/releases-page.ts @@ -0,0 +1,25 @@ +import type { Page, Locator } from "@playwright/test"; + +export class ReleasesPage { + public readonly pageBody: Locator; + public readonly textList: string[] = [ + "Previous releases of QGIS are", + "More older releases are", + "Plugins for QGIS are also", + "Both QGIS and QGIS server are", + "From build tests (github", + "See Unit testing", + "See OGC conformance testing", + "Recent tests output can be", + "List of Releases", + "Tests" + ]; + public readonly listOfReleases: Locator; + public readonly listOfReleasesLink: Locator; + public readonly testsLink: Locator; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.listOfReleasesLink = this.page.getByRole("link", { name: "List of releases" }); + this.testsLink = this.page.getByRole("link", { name: "Tests" }); + } +} diff --git a/playwright/ci-test/tests/fixtures/report-page.ts b/playwright/ci-test/tests/fixtures/report-page.ts new file mode 100644 index 000000000..a13aabc20 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/report-page.ts @@ -0,0 +1,34 @@ +import type { Page, Locator } from "@playwright/test"; + +export class ReportsPage { + public readonly pageBody: Locator; + public readonly certificationImage: Locator; + public readonly ogcCertificationLink: Locator; + public readonly performanceLink: Locator; + public readonly securityLink: Locator; + public readonly textList: string[] = [ + "Daily Reports", + "OGC Certification", + "Performance", + "QGIS Server", + "In order to keep an eye on", + "WMS", + "OGC API Features (aka WFS", + "WFS", + "Latest reports", + "At the moment, two tools are", + "The first one is MS-Perfs", + "The second one is Graffiti,", + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.certificationImage = this.page.locator("p:nth-child(5) > img"); + this.ogcCertificationLink = this.page.getByRole("link", { + name: "OGC Certification", + }); + this.performanceLink = this.page.getByRole("link", { + name: "Performance", + }); + this.securityLink = this.page.getByRole("link", { name: "Security" }); + } +} diff --git a/playwright/ci-test/tests/fixtures/roadmap-page.ts b/playwright/ci-test/tests/fixtures/roadmap-page.ts new file mode 100644 index 000000000..9b252a34c --- /dev/null +++ b/playwright/ci-test/tests/fixtures/roadmap-page.ts @@ -0,0 +1,85 @@ +import type { Page, Locator } from "@playwright/test"; + +export class RoadmapPage { + public readonly pageBody: Locator; + public readonly event: Locator; + public readonly latest: Locator; + public readonly longTermRepo: Locator; + public readonly freeze: Locator; + public readonly date: Locator; + public readonly weekNumber: Locator; + public readonly weeks: Locator; + public readonly longTermReleaseBegin: Locator; + public readonly regularReleaseBegin: Locator; + public readonly featureFreezeEnd: Locator; + public readonly pointReleaseLatest: Locator; + public readonly extraPointRelease: Locator; + public readonly currentlySupportedReleases: Locator; + public readonly nextReleases: Locator; + public readonly platform: Locator; + public readonly location: Locator; + public readonly windows: Locator; + public readonly osgeo4w: Locator; + public readonly linux: Locator; + public readonly debianUbuntu: Locator; + public readonly macOS: Locator; + public readonly textList: string[] = [ + "Road Map", + "Development phase", + "Feature freeze", + "Release", + "Release schedule", + "Schedule", + "Event legend", + "Location of prereleases / nightly builds", + ]; + + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.event = this.page.getByRole("cell", { name: "Event" }); + this.latest = this.page.getByRole("cell", { + name: "Latest", + exact: true, + }); + this.longTermRepo = this.page.getByRole("cell", { + name: "Long-Term Repo", + }); + this.freeze = this.page.getByRole("cell", { + name: "Freeze", + exact: true, + }); + this.date = this.page.getByRole("cell", { name: "Date" }); + this.weekNumber = this.page.getByRole("cell", { name: "Week #" }); + this.weeks = this.page.getByRole("cell", { name: "Weeks" }); + this.longTermReleaseBegin = this.page.getByRole("cell", { + name: "Long term release, begin of", + }); + this.regularReleaseBegin = this.page.getByRole("cell", { + name: "Regular release, begin of new", + }); + this.featureFreezeEnd = this.page.getByRole("cell", { + name: "Feature freeze, end of", + }); + this.pointReleaseLatest = this.page.getByRole("cell", { + name: "Point release of latest", + }); + this.extraPointRelease = this.page.getByRole("cell", { + name: "Extra Point release", + }); + this.currentlySupportedReleases = this.page.getByRole("cell", { + name: "currently supported releases", + }); + this.nextReleases = this.page.getByRole("cell", { + name: "next releases", + }); + this.platform = this.page.getByRole("cell", { name: "Platform" }); + this.location = this.page.getByRole("cell", { name: "Location" }); + this.windows = this.page.getByRole("cell", { name: "Windows" }); + this.osgeo4w = this.page.getByRole("cell", { name: "OSGeo4W" }); + this.linux = this.page.getByRole("cell", { name: "Linux" }); + this.debianUbuntu = this.page.getByRole("cell", { + name: "Debian/Ubuntu", + }); + this.macOS = this.page.getByRole("cell", { name: "MacOS" }); + } +} diff --git a/playwright/ci-test/tests/fixtures/sidebar.ts b/playwright/ci-test/tests/fixtures/sidebar.ts new file mode 100644 index 000000000..03a7a910b --- /dev/null +++ b/playwright/ci-test/tests/fixtures/sidebar.ts @@ -0,0 +1,127 @@ +import type { Page, Locator } from "@playwright/test"; + +export class Sidebar { + public readonly sidebar: Locator; + public readonly productLink: Locator; + public readonly overviewLink: Locator; + public readonly caseStudiesLink: Locator; + public readonly pluginsLink: Locator; + public readonly visualChangelogsLink: Locator; + public readonly communityLink: Locator; + public readonly getInvolvedLink: Locator; + public readonly becomeCertifiedMemberLink: Locator; + public readonly qgisFoundationLink: Locator; + public readonly projectOrganisationLink: Locator; + public readonly membersBlogsLink: Locator; + public readonly fundingLink: Locator; + public readonly downloadLink: Locator; + public readonly resourcesLink: Locator; + public readonly qgisResourcesLink: Locator; + public readonly membershipLink: Locator; + public readonly installationGuideLink: Locator; + public readonly documentationLink: Locator; + public readonly releasesLink: Locator; + public readonly roadmapLink: Locator; + public readonly reportsLink: Locator; + public readonly booksLink: Locator; + public readonly supportLink: Locator; + public readonly membersLink: Locator; + public readonly pastMembersLink: Locator; + + constructor(public readonly page: Page) { + this.sidebar = this.page.locator("#sidebar"); + this.productLink = this.sidebar.getByRole("link", { + name: "Product", + }); + this.overviewLink = this.sidebar.getByRole("link", { + name: "Overview", + }); + this.caseStudiesLink = this.sidebar.getByRole("link", { + name: "Case studies", + }); + this.pluginsLink = this.sidebar.getByRole("link", { + name: "Plugins", + }); + this.visualChangelogsLink = this.sidebar.getByRole("link", { + name: "Visual Changelogs", + }); + this.communityLink = this.sidebar.getByRole("link", { + name: "Community", + }); + this.getInvolvedLink = this.sidebar.getByRole("link", { + name: "Get involved", + }); + this.becomeCertifiedMemberLink = this.sidebar.getByRole("link", { + name: "Become a certified member", + }); + this.qgisFoundationLink = this.sidebar.getByRole("link", { + name: "QGIS Foundation", + }); + this.projectOrganisationLink = this.sidebar.getByRole("link", { + name: "Project Organisation", + }); + this.membersBlogsLink = this.sidebar.getByRole("link", { + name: "Members Blogs", + }); + this.fundingLink = this.sidebar.getByRole("link", { + name: "Funding", + }); + this.downloadLink = this.sidebar.getByRole("link", { + name: "Download", + }); + this.resourcesLink = this.sidebar.getByRole("link", { + name: "Resources", + exact: true, + }); + this.qgisResourcesLink = this.sidebar.getByRole("link", { + name: "QGIS resources", + }); + + this.membershipLink = this.sidebar.getByRole("link", { + name: "Membership", + }); + + this.installationGuideLink = this.sidebar.getByRole("link", { + name: "Installation guide", + }); + + this.documentationLink = this.sidebar.getByRole("link", { + name: "Documentation", + }); + + this.releasesLink = this.sidebar.getByRole("link", { + name: "Releases", + exact: true, + }); + + this.roadmapLink = this.sidebar.getByRole("link", { + name: "Roadmap", + exact: true, + }); + + this.reportsLink = this.sidebar.getByRole("link", { + name: "Reports", + exact: true, + }); + + this.booksLink = this.sidebar.getByRole("link", { + name: "Books", + exact: true, + }); + + this.supportLink = this.sidebar.getByRole("link", { + name: "Support", + exact: true, + }); + + this.membersLink = this.sidebar.getByRole("link", { + name: "Members", + exact: true, + }); + + this.pastMembersLink = this.sidebar.getByRole("link", { + name: "Past Members", + exact: true, + }); + } +} diff --git a/playwright/ci-test/tests/fixtures/support-page.ts b/playwright/ci-test/tests/fixtures/support-page.ts new file mode 100644 index 000000000..f45a614f1 --- /dev/null +++ b/playwright/ci-test/tests/fixtures/support-page.ts @@ -0,0 +1,90 @@ +import type { Page, Locator } from "@playwright/test"; + +export class SupportPage { + public readonly url: string = "/resources/support/"; + public readonly pageBody: Locator; + public readonly textList: string[] = [ + "Support", + "Mailing Lists", + "QGIS has a bunch of mailing", + "If you are going to ask", + "StackExchange", + "On http://gis.stackexchange.", + "Communication channels", + "Telegram", + "There is a lot of user and", + "To join: install Telegram on", + "There is also a web version (", + "Matrix / IRC", + "Matrix (https://matrix.org)", + "To use Matrix: create an", + "To use IRC: install an IRC", + "Facebook", + "For Facebook users, an", + "User Groups", + "Local QGIS user groups are a", + "See User Groups to read about", + "Website", + "The website should be used to", + "Good luck with the", + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + } + async goto() { + await this.page.goto(this.url); + } +} + +export class OtherSupportPage { + public readonly pageBody: Locator; + public readonly communicationChannelsLink: Locator; + public readonly commercialSupportLink: Locator; + public readonly commercialSupportText: Locator; + public readonly commercialSupportSection: Locator; + public readonly coreContributorsSection: Locator; + public readonly stackExchangeLink: Locator; + public readonly websiteCreationLink: Locator; + public readonly textList: string[] = [ + "Commercial support", + "Do you plan to use QGIS in", + "Note ΒΆ we take responsibility", + "Core contributors", + "3liz (based in France) offers", + ]; + constructor(public readonly page: Page) { + this.pageBody = this.page.locator("body"); + this.communicationChannelsLink = this.page.getByRole("link", { + name: "Communication channels", + }); + this.commercialSupportLink = this.page.getByRole("link", { + name: "Commercial support", + }); + this.commercialSupportSection = this.page.locator( + "#commercial-support", + ); + this.coreContributorsSection = this.page.locator("#core-contributors"); + this.stackExchangeLink = this.page.getByRole("link", { + name: "StackExchange", + }); + this.websiteCreationLink = this.page.getByRole("link", { + name: "Website Creation", + }); + } + + async navigateToCommunicationChannels() { + await this.communicationChannelsLink.click(); + } + + async navigateToCommercialSupport() { + await this.commercialSupportLink.click(); + } + + async navigateToStackExchange() { + await this.stackExchangeLink.click(); + } + + async navigateToWebsiteCreation() { + await this.websiteCreationLink.click(); + } +}