Skip to content

Commit

Permalink
Tests - Migrate overview tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and github-actions[bot] committed Feb 4, 2025
1 parent 50bfa88 commit 916552a
Showing 1 changed file with 58 additions and 47 deletions.
105 changes: 58 additions & 47 deletions tests/end2end/playwright/overview.spec.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,79 @@
// @ts-check
import { test, expect } from '@playwright/test';
import { gotoMap } from './globals';
import { expectParametersToContain } from './globals';
import {ProjectPage} from "./pages/project";

test.describe('Overview', () => {
test('2154', async ({ page }) => {
test.describe('Overview',
{
tag: ['@readonly'],
}, () => {

test('EPSG:2154', async ({ page }) => {
const requestPromise = page.waitForRequest(/GetMap/);

const url = '/index.php/view/map/?repository=testsrepository&project=overview-2154';
await gotoMap(url, page);
const project = new ProjectPage(page, 'overview-2154');
await project.open();

const request = await requestPromise;
const requestUrl = request.url();
expect(requestUrl).toContain('SERVICE=WMS');
expect(requestUrl).toContain('VERSION=1.3.0');
expect(requestUrl).toContain('REQUEST=GetMap');
expect(requestUrl).toContain('FORMAT=image%2Fpng');
expect(requestUrl).toContain('TRANSPARENT=TRUE');
expect(requestUrl).toContain('LAYERS=Overview');
expect(requestUrl).toContain('CRS=EPSG%3A2154');
expect(requestUrl).toContain('STYLES=');
expect(requestUrl).toContain('WIDTH=232');
expect(requestUrl).toContain('HEIGHT=110');
expect(requestUrl).toContain('BBOX=758432.36%2C6273694.3%2C782221.64%2C6284973.7');
const expectedParameters = {
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetMap',
'FORMAT': 'image/png',
'TRANSPARENT': /\b(\w*^true$\w*)\b/gmi,
'LAYERS': 'Overview',
'CRS': 'EPSG:2154',
'STYLES': '',
'WIDTH': '232',
'HEIGHT': '110',
'BBOX': /758432.36\d*,6273694.3\d*,782221.64\d*,6284973.7\d*/,
}
await expectParametersToContain('GetMap', request.url(), expectedParameters);
});

test('4326', async ({ page }) => {
test('EPSG:4326', async ({ page }) => {
const requestPromise = page.waitForRequest(/GetMap/);

const url = '/index.php/view/map/?repository=testsrepository&project=overview-4326';
await gotoMap(url, page);
const project = new ProjectPage(page, 'overview-4326');
await project.open();

const request = await requestPromise;
const requestUrl = request.url();
expect(requestUrl).toContain('SERVICE=WMS');
expect(requestUrl).toContain('VERSION=1.3.0');
expect(requestUrl).toContain('REQUEST=GetMap');
expect(requestUrl).toContain('FORMAT=image%2Fpng');
expect(requestUrl).toContain('TRANSPARENT=TRUE');
expect(requestUrl).toContain('LAYERS=overview');
expect(requestUrl).toContain('CRS=EPSG%3A4326');
expect(requestUrl).toContain('STYLES=');
expect(requestUrl).toContain('WIDTH=232');
expect(requestUrl).toContain('HEIGHT=110');
expect(requestUrl).toContain('BBOX=43.55949198040038%2C3.765259498508828%2C43.65959251444461%2C3.9763806248566715');
const expectedParameters = {
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetMap',
'FORMAT': 'image/png',
'TRANSPARENT': /\b(\w*^true$\w*)\b/gmi,
'LAYERS': 'overview',
'CRS': 'EPSG:4326',
'STYLES': '',
'WIDTH': '232',
'HEIGHT': '110',
'BBOX': /43.559491\d*,3.765259\d*,43.659592\d*,3.976380\d*/,
}
await expectParametersToContain('GetMap', request.url(), expectedParameters);
});

test('3857', async ({ page }) => {
test('EPSG:3857', async ({ page }) => {
const requestPromise = page.waitForRequest(/GetMap/);

const url = '/index.php/view/map/?repository=testsrepository&project=overview-3857';
await gotoMap(url, page);
const project = new ProjectPage(page, 'overview-3857');
await project.open();

const request = await requestPromise;
const requestUrl = request.url();
expect(requestUrl).toContain('SERVICE=WMS');
expect(requestUrl).toContain('VERSION=1.3.0');
expect(requestUrl).toContain('REQUEST=GetMap');
expect(requestUrl).toContain('FORMAT=image%2Fpng');
expect(requestUrl).toContain('TRANSPARENT=TRUE');
expect(requestUrl).toContain('LAYERS=Overview_1');
expect(requestUrl).toContain('CRS=EPSG%3A3857');
expect(requestUrl).toContain('STYLES=');
expect(requestUrl).toContain('WIDTH=232');
expect(requestUrl).toContain('HEIGHT=110');
expect(requestUrl).toContain('BBOX=411699.3269569552%2C5396012.897530658%2C450848.7321200949%2C5414575.115495941');
const expectedParameters = {
'SERVICE': 'WMS',
'VERSION': '1.3.0',
'REQUEST': 'GetMap',
'FORMAT': 'image/png',
'TRANSPARENT': /\b(\w*^true$\w*)\b/gmi,
'LAYERS': 'Overview_1',
'CRS': 'EPSG:3857',
'STYLES': '',
'WIDTH': '232',
'HEIGHT': '110',
'BBOX': /411699.32\d*,5396012.89\d*,450848.73\d*,5414575.11\d*/,
}
await expectParametersToContain('GetMap', request.url(), expectedParameters);
});
});

0 comments on commit 916552a

Please sign in to comment.