-
-
Notifications
You must be signed in to change notification settings - Fork 145
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 #4550 from rldhont/tests-e2e-playwright-print-empt…
…y-external-baselayer Tests e2e playwright: Print empty or external base layer
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
tests/end2end/playwright/print_in_project_projection.spec.js
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,60 @@ | ||
// @ts-check | ||
const { test, expect } = require('@playwright/test'); | ||
const { gotoMap } = require('./globals'); | ||
|
||
test.describe('Print in project projection', () => { | ||
|
||
test.beforeEach(async ({ page }) => { | ||
const url = '/index.php/view/map/?repository=testsrepository&project=print_in_project_projection'; | ||
await gotoMap(url, page); | ||
|
||
await page.locator('#button-print').click(); | ||
}); | ||
|
||
test('Print empty', async ({ page }) => { | ||
await page.locator('#switcher-baselayer').getByRole('combobox').selectOption('empty'); | ||
await page.locator('#print-scale').selectOption('1000'); | ||
page.once('request', request => { | ||
const postData = request.postData(); | ||
expect(postData).toContain('SERVICE=WMS') | ||
expect(postData).toContain('REQUEST=GetPrint') | ||
expect(postData).toContain('VERSION=1.3.0') | ||
expect(postData).toContain('FORMAT=pdf') | ||
expect(postData).toContain('TRANSPARENT=true') | ||
expect(postData).toContain('CRS=EPSG%3A3943') | ||
expect(postData).toContain('DPI=100') | ||
expect(postData).toContain('TEMPLATE=Paysage%20A4') | ||
expect(postData).toMatch(/map1%3AEXTENT=1697873.\d+%2C2216859.\d+%2C1698164.\d+%2C2217051.\d+/) | ||
expect(postData).toContain('map1%3ASCALE=1000') | ||
expect(postData).toContain('map1%3ALAYERS=reseau') | ||
expect(postData).toContain('map1%3ASTYLES=default') | ||
expect(postData).toContain('map1%3AOPACITIES=255') | ||
// Disabled because of the migration when project is saved with QGIS >= 3.32 | ||
// expect(postData).toContain('multiline_label=Multiline%20label'); | ||
}); | ||
await page.locator('#print-launch').click(); | ||
}) | ||
|
||
test('Print external baselayer', async ({ page }) => { | ||
await page.locator('#print-scale').selectOption('1000'); | ||
page.once('request', request => { | ||
const postData = request.postData(); | ||
expect(postData).toContain('SERVICE=WMS') | ||
expect(postData).toContain('REQUEST=GetPrint') | ||
expect(postData).toContain('VERSION=1.3.0') | ||
expect(postData).toContain('FORMAT=pdf') | ||
expect(postData).toContain('TRANSPARENT=true') | ||
expect(postData).toContain('CRS=EPSG%3A3943') | ||
expect(postData).toContain('DPI=100') | ||
expect(postData).toContain('TEMPLATE=Paysage%20A4') | ||
expect(postData).toMatch(/map1%3AEXTENT=1697873.\d+%2C2216859.\d+%2C1698164.\d+%2C2217051.\d+/) | ||
expect(postData).toContain('map1%3ASCALE=1000') | ||
expect(postData).toContain('map1%3ALAYERS=Photographies_aeriennes%2Creseau') | ||
expect(postData).toContain('map1%3ASTYLES=default%2Cdefault') | ||
expect(postData).toContain('map1%3AOPACITIES=255%2C255') | ||
// Disabled because of the migration when project is saved with QGIS >= 3.32 | ||
// expect(postData).toContain('multiline_label=Multiline%20label'); | ||
}); | ||
await page.locator('#print-launch').click(); | ||
}) | ||
}) |