Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[end2end] cors and projet filename test converted from cypress to playwright #4009

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:

- name: Run Playwright tests
id: test-playwright
run: cd end2end && npx playwright test --project=chromium
run: cd end2end && npx playwright test --project=end2end

- name: Notify in case of playwright failure, from mainstream branches only
uses: peter-evans/commit-comment@v3
Expand Down
20 changes: 0 additions & 20 deletions tests/end2end/cypress/integration/cors.js

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions tests/end2end/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ export default defineConfig({
dependencies: ['setup'],
},

{
name: 'end2end',
use: {
browserName: 'chromium',
},
dependencies: ['setup'],
testIgnore: '**/localonly/**',
},
/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
Expand Down
15 changes: 15 additions & 0 deletions tests/end2end/playwright/dot-or-space-in-project-filename.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from '@playwright/test';

test.describe('Filename with dot or space', () => {

test('projet with dot or space can be loaded', async ({ page }) => {
// project file with dot
await page.goto('/index.php/view/map/?repository=testsrepository&project=base_layers.withdot');await expect(page.locator(
'#node-quartiers')).toBeVisible();
// project file with space
await page.goto('/index.php/view/map/?repository=testsrepository&project=base_layers+with+space');await expect(page.locator(

'#node-quartiers')).toBeVisible();
});

});
24 changes: 24 additions & 0 deletions tests/end2end/playwright/localonly/cors.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { test, expect } from '@playwright/test';

test.describe('Cors', function () {

test('send authorized request', async function ({ page }, testInfo) {
await page.goto('http://othersite.local:8130');
await page.locator('#launch-request').click();
await expect(page.locator('#status')).toHaveText('200');
await expect(page.locator('#response')).not.toBeEmpty();
expect(testInfo.stderr).toHaveLength(0);

});


test('send unauthorized request', async function ({ page }, testInfo) {
await page.goto(
'http://othersite.local:8130');
await page.locator('#launch-request-bad').click();
await expect(page.locator('#status_bad')).toBeEmpty();
await expect(page.locator('#response_bad')).toBeEmpty();
expect(testInfo.stderr).not.toBe('');
});

});
Loading