-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FE] Automate click Edit map in OSM and control OSM opening (web OSM) (…
…#741) * added open OSM tests * fix to use URL constructor * fix to go back to split method * rename method
- Loading branch information
1 parent
0d11600
commit 8c5d5f6
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
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,30 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from './fixtures/test-options.ts'; | ||
import { getProjects } from './page-objects/helperBase.ts'; | ||
|
||
const projects = getProjects(); | ||
|
||
for (const project of projects) { | ||
test(`As Guest, I can go to ${project.title}, open map and open OSM at map coordinates`, async ({ | ||
context, | ||
pageManager, | ||
}) => { | ||
await pageManager.atBrowser.openProject(project); | ||
await pageManager.fromNavigationMenu.goToMap(); | ||
|
||
// TO DO: remove this action after 18582 issue is fixed | ||
await pageManager.atMap.goToSpecificAreaByUrl(10.597, 53.9196, 27.5097, project); | ||
|
||
const coordinates = await pageManager.atMap.getViewportFromUrl(); | ||
|
||
// Start waiting for new page being opened | ||
const newPagePromise = context.waitForEvent('page'); | ||
|
||
await (await pageManager.atToolBar.getButtonByText('Edit map in OSM')).click(); | ||
const newPage = await newPagePromise; | ||
|
||
await pageManager.atMap.waitForUrlToMatchPattern(/openstreetmap/, newPage); | ||
const osmCoordinates = await pageManager.atMap.getViewportFromUrl(newPage); | ||
expect(osmCoordinates).toStrictEqual(coordinates); | ||
}); | ||
} |
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,29 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from './fixtures/test-options.ts'; | ||
import { getProjects } from './page-objects/helperBase.ts'; | ||
|
||
const projects = getProjects(); | ||
|
||
for (const project of projects) { | ||
test(`As User with no rights, I can go to ${project.title}, open map and open Rapid OSM editor at map coordinates`, async ({ | ||
context, | ||
pageManager, | ||
}) => { | ||
await pageManager.atBrowser.openProject(project, { skipCookieBanner: true }); | ||
await pageManager.fromNavigationMenu.goToMap(); | ||
|
||
// TO DO: remove this action after 18582 issue is fixed | ||
await pageManager.atMap.goToSpecificAreaByUrl(10.597, 53.9196, 27.5097, project); | ||
|
||
const coordinates = await pageManager.atMap.getViewportFromUrl(); | ||
|
||
// Start waiting for new page being opened | ||
const newPagePromise = context.waitForEvent('page'); | ||
|
||
await (await pageManager.atToolBar.getButtonByText('Edit map in OSM')).click(); | ||
const newPage = await newPagePromise; | ||
await pageManager.atMap.waitForUrlToMatchPattern(/rapideditor/, newPage); | ||
const osmCoordinates = await pageManager.atMap.getViewportFromUrl(newPage); | ||
expect(osmCoordinates).toStrictEqual(coordinates); | ||
}); | ||
} |
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