Skip to content

Commit

Permalink
upgrade puppeteer to v22
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmail committed Feb 14, 2024
1 parent 4e25f6d commit 16f28ac
Show file tree
Hide file tree
Showing 4 changed files with 469 additions and 430 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"http": "^0.0.1-security",
"http-proxy": "^1.18.1",
"mocha": "^10.0",
"puppeteer": "^21.0",
"puppeteer": "^22.0",
"rollup": "^4.9.0",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-livereload": "^2.0.0",
Expand Down
11 changes: 8 additions & 3 deletions test/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ describe('Details Page', function () {
});

it('should have OSM link', async function () {
const url = 'https://www.openstreetmap.org/relation/1155956';

assert.strictEqual((await page.$$('a[href="https://www.openstreetmap.org/relation/1155956"]')).length, 2);
assert.strictEqual((await page.$$eval(`a[href="${url}"]`, (links) => links.length)), 2);
});

// Reverse-only installation have no search index, therefor no keywords
if (!reverse_only) {
it('should change url and add new header on clicking display keywords', async function () {
let current_url;
let display_headers;
let [display_keywords_btn] = await page.$x("//a[contains(text(), 'display keywords')]");
let [display_keywords_btn] = await page.$$(
"xpath/.//a[contains(text(), 'display keywords')]"
);

await display_keywords_btn.evaluate(node => node.click());
await page.waitForNavigation();
Expand Down Expand Up @@ -115,7 +118,9 @@ describe('Details Page', function () {
assert.ok(page_content.includes('Gafleistrasse'));

let current_url;
let [child_places_btn] = await page.$x("//a[contains(text(), 'display child places')]");
let [child_places_btn] = await page.$$(
"xpath/.//a[contains(text(), 'display child places')]"
);

await child_places_btn.evaluate(node => node.click());
await page.waitForNavigation();
Expand Down
4 changes: 3 additions & 1 deletion test/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ describe('Search Page', function () {
});

it('should have show more results button', async function () {
let [search_more_btn] = await page.$x("//a[contains(text(), 'Search for more results')]");
let [search_more_btn] = await page.$$(
"xpath/.//a[contains(text(), 'Search for more results')]"
);
assert.ok(search_more_btn);
});

Expand Down
Loading

0 comments on commit 16f28ac

Please sign in to comment.