-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from Xpirix/fix_archive_link_place
- Loading branch information
Showing
9 changed files
with
64 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { test as base, expect } from "@playwright/test"; | ||
import { Sidebar } from "./fixtures/sidebar"; | ||
import { ArchivePage } from "./fixtures/archive-page"; | ||
|
||
type ResourcesPageFixtures = { | ||
sidebar: Sidebar; | ||
archivePage: ArchivePage; | ||
}; | ||
|
||
const test = base.extend<ResourcesPageFixtures>({ | ||
sidebar: async ({ page }, use) => { | ||
const sidebar = new Sidebar(page); | ||
await use(sidebar); | ||
}, | ||
archivePage: async ({ page }, use) => { | ||
const archivePage = new ArchivePage(page); | ||
await use(archivePage); | ||
}, | ||
}); | ||
|
||
test.describe("Archive pages", () => { | ||
test.beforeEach(async ({ archivePage }) => { | ||
// Go to the resources url before each test. | ||
await archivePage.goto(); | ||
}); | ||
|
||
test("Archive", async ({ page, sidebar, archivePage }) => { | ||
await expect(sidebar.archiveLink).toBeVisible(); | ||
await sidebar.archiveLink.click(); | ||
|
||
for (const text of archivePage.textList) { | ||
await expect(archivePage.pageBody).toContainText(text); | ||
} | ||
await expect(archivePage.archiveHeading).toBeVisible(); | ||
await expect(archivePage.downloadLink).toBeVisible(); | ||
await expect(archivePage.macOsReleaseLink).toBeVisible(); | ||
await expect(archivePage.osgeoDownloadLink).toBeVisible(); | ||
await expect(archivePage.pluginsLink).toBeVisible(); | ||
}); | ||
}); |
14 changes: 9 additions & 5 deletions
14
...t/ci-test/tests/fixtures/releases-page.ts → ...ht/ci-test/tests/fixtures/archive-page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
import type { Page, Locator } from "@playwright/test"; | ||
|
||
export class ReleasesPage { | ||
export class ArchivePage { | ||
private readonly url: string = "/archive/"; | ||
public readonly pageBody: Locator; | ||
public readonly textList: string[] = [ | ||
"Release Archive" | ||
"Archive" | ||
]; | ||
public readonly listOfReleases: Locator; | ||
public readonly releaseHeading: Locator; | ||
public readonly listOfArchive: Locator; | ||
public readonly archiveHeading: Locator; | ||
public readonly downloadLink: Locator; | ||
public readonly macOsReleaseLink: Locator; | ||
public readonly osgeoDownloadLink: Locator; | ||
public readonly pluginsLink: Locator; | ||
constructor(public readonly page: Page) { | ||
this.pageBody = this.page.locator("body"); | ||
this.releaseHeading = this.page.getByRole('heading', { name: 'Release Archive' }); | ||
this.archiveHeading = this.page.getByRole('heading', { name: 'Archive' }); | ||
this.downloadLink = this.page.getByRole('link', { name: 'QGIS.org hosted downloads' }); | ||
this.macOsReleaseLink = this.page.getByRole('link', { name: 'Older releases for macOS / OS' }); | ||
this.osgeoDownloadLink = this.page.getByRole('link', { name: 'OSGeo hosted downloads' }); | ||
this.pluginsLink = this.page.getByRole('link', { name: 'at plugins.qgis.org' }); | ||
} | ||
async goto() { | ||
await this.page.goto(this.url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters