Skip to content

Commit cb02310

Browse files
authored
Merge pull request #5060 from Gustry/ide-warning
Playwright - Fix some warnings about docstrings and parameters from the JavaScript IDE
2 parents 8513b32 + cedee84 commit cb02310

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/end2end/playwright/globals.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22
const { expect } = require('@playwright/test');
3+
import { Page } from '@playwright/test';
34

45
async function NoErrors(page, checkLayerTreeView = true) {
56
// No error
@@ -14,13 +15,13 @@ async function NoErrors(page, checkLayerTreeView = true) {
1415
/**
1516
* CatchErrors function
1617
* Some checks when the map is on error
17-
* @param page The page object
18+
* @param {Page} page The page object
1819
* @param {int} layersInTreeView The number of layers to find in the treeview.
1920
*/
2021
async function CatchErrors(page, layersInTreeView = 0) {
2122
// Error
2223
await expect(page.locator('p.error-msg')).toHaveCount(1);
23-
await expect(page.locator('#switcher lizmap-treeview ul li')).toHaveCount(layersInTreeView);
24+
await expect(page.locator('#switcher .lizmap-treeview ul li')).toHaveCount(layersInTreeView);
2425
// Error message displayed
2526
await expect(page.getByText('An error occurred while loading this map. Some necessary resources may temporari')).toBeVisible();
2627
// Go back home link
@@ -31,7 +32,7 @@ async function CatchErrors(page, layersInTreeView = 0) {
3132
* gotoMap function
3233
* Helper to load a map and do some basic checks
3334
* @param {string} url The URL of the map to load
34-
* @param {page} page The page object
35+
* @param {Page} page The page object
3536
* @param {boolean} mapMustLoad If the loading of the map must be successful or not. Some error might be triggered when loading the map, on purpose.
3637
* @param {int} layersInTreeView The number of layers to find in the treeview if the map is on error.
3738
* @param {boolean} waitForGetLegendGraphics
@@ -65,6 +66,12 @@ export async function gotoMap(url, page, mapMustLoad = true, layersInTreeView =
6566
}
6667
}
6768

69+
/**
70+
* reloadMap function
71+
* Helper to reload a map and do some basic checks
72+
* @param {Page} page The page object
73+
* @param {boolean} check If some basic checks must be done.
74+
*/
6875
export async function reloadMap(page, check = true) {
6976
// TODO keep this function synchronized with the Cypress equivalent
7077

0 commit comments

Comments
 (0)