Skip to content

Commit

Permalink
Merge pull request #350 from Xpirix/fix_archive_link_place
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux authored Jul 19, 2024
2 parents 79efabf + cb18502 commit 9c5f898
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 40 deletions.
12 changes: 6 additions & 6 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ sectionPagesMenu = 'main'
#pre = "<i class='fa-solid fa-circle-down mr-1'></i>"
weight = 80 # Sets the menu order

[[menu.main]]
name = "Archive"
url = "/archive/"
#pre = "<i class='fa-solid fa-circle-down mr-1'></i>"
weight = 90 # Sets the menu order

[[menu.main]]
name = "Funding"
url = "/funding/donate"
Expand Down Expand Up @@ -359,12 +365,6 @@ sectionPagesMenu = 'main'
weight = 10


[[menu.main]]
parent = "Resources"
name = "Releases"
url = "/resources/releases/"
weight = 30

[[menu.main]]
parent = "Resources"
name = "Testing"
Expand Down
4 changes: 2 additions & 2 deletions content/resources/releases.md → content/archive/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
type: "page"
title: "Releases"
title: "Archive"
subtitle: ""
draft: false
sidebar: true
Expand All @@ -10,7 +10,7 @@ Reviewer: Tim Sutton

{{< content-start >}}

# Release Archive
# Archive

Previous releases of QGIS are available at the following locations:

Expand Down
3 changes: 1 addition & 2 deletions playwright/ci-test/tests/01-home-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test.describe("Home page", () => {
await header.resourcesLink.hover();
await expect(header.documentationLink).toBeVisible();
await expect(header.installationGuideLink).toBeVisible();
await expect(header.releasesLink).toBeVisible();
await expect(header.roadmapLink).toBeVisible();
await expect(header.reportsLink).toBeVisible();
await expect(header.booksLink).toBeVisible();
Expand Down Expand Up @@ -112,7 +111,7 @@ test.describe("Home page", () => {
await expect(footer.membersBlogsList).toBeVisible();
await expect(footer.documentationLink).toBeVisible();
await expect(footer.installationGuideLink).toBeVisible();
await expect(footer.releasesLink).toBeVisible();
await expect(footer.archiveLink).toBeVisible();
await expect(footer.roadmapLink).toBeVisible();
await expect(footer.reportsLink).toBeVisible();
await expect(footer.booksLink).toBeVisible();
Expand Down
20 changes: 0 additions & 20 deletions playwright/ci-test/tests/06-resources-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ 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";
Expand All @@ -11,7 +10,6 @@ type ResourcesPageFixtures = {
sidebar: Sidebar;
qgisResourcesPage: QgisResourcesPage;
installationGuidePage: InstallationGuidePage;
releasesPage: ReleasesPage;
roadmapPage: RoadmapPage;
reportsPage: ReportsPage;
booksPage: BooksPage;
Expand All @@ -30,10 +28,6 @@ const test = base.extend<ResourcesPageFixtures>({
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);
Expand Down Expand Up @@ -199,20 +193,6 @@ test.describe("Resources pages", () => {
}
});

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.releaseHeading).toBeVisible();
await expect(releasesPage.downloadLink).toBeVisible();
await expect(releasesPage.macOsReleaseLink).toBeVisible();
await expect(releasesPage.osgeoDownloadLink).toBeVisible();
await expect(releasesPage.pluginsLink).toBeVisible();
});

test("Roadmap", async ({ sidebar, roadmapPage }) => {
await expect(sidebar.roadmapLink).toBeVisible();
await sidebar.roadmapLink.click();
Expand Down
40 changes: 40 additions & 0 deletions playwright/ci-test/tests/08-archive-page.spec.ts
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();
});
});
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);
}
}
4 changes: 2 additions & 2 deletions playwright/ci-test/tests/fixtures/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Footer {
public readonly membersBlogsList: Locator;
public readonly documentationLink: Locator;
public readonly installationGuideLink: Locator;
public readonly releasesLink: Locator;
public readonly archiveLink: Locator;
public readonly roadmapLink: Locator;
public readonly reportsLink: Locator;
public readonly booksLink: Locator;
Expand Down Expand Up @@ -86,7 +86,6 @@ export class Footer {
this.installationGuideLink = this.liElement.filter({
hasText: "Installation guide",
});
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" });
Expand All @@ -111,6 +110,7 @@ export class Footer {
name: "Visual Style Guide",
});
this.goodiesLink = this.page.getByRole("link", { name: "Goodies" });
this.archiveLink = this.page.getByRole("link", { name: "Archive" });
this.logoImage = this.page.getByRole("img", { name: "Logo" });
this.facebookLink = this.page.getByRole("link", { name: "" });
this.youtubeLink = this.page.getByRole("link", { name: "" });
Expand Down
6 changes: 3 additions & 3 deletions playwright/ci-test/tests/fixtures/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class Sidebar {
public readonly documentationLink: Locator;
public readonly membershipLink: Locator;
public readonly installationGuideLink: Locator;
public readonly releasesLink: Locator;
public readonly archiveLink: Locator;
public readonly roadmapLink: Locator;
public readonly reportsLink: Locator;
public readonly booksLink: Locator;
Expand Down Expand Up @@ -85,8 +85,8 @@ export class Sidebar {
name: "Installation guide",
});

this.releasesLink = this.sidebar.getByRole("link", {
name: "Releases",
this.archiveLink = this.sidebar.getByRole("link", {
name: "Archive",
exact: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<a href="{{ absURL "license" }}" class="column is-narrow">License</a>
<a href="{{ absURL "styleguide" }}" class="column is-narrow">Visual Style Guide</a>
<a href="{{ absURL "goodies" }}" class="column is-narrow">Goodies</a>
<a href="{{ absURL "archive" }}" class="column is-narrow">Archive</a>

</div>
<div class="columns is-desktop issue-report-link is-justify-content-center">
Expand Down

0 comments on commit 9c5f898

Please sign in to comment.