-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: add rolling stock selectos e2e test for operational studies
- Loading branch information
Showing
29 changed files
with
397 additions
and
159 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
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
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
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
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 |
---|---|---|
@@ -1,56 +1,56 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
import { PlaywrightHomePage } from './pages/home-page-model'; | ||
import HomePage from './pages/home-page-model'; | ||
|
||
// Describe the test suite for the home page of OSRD | ||
test.describe('Home page OSRD', () => { | ||
let playwrightHomePage: PlaywrightHomePage; | ||
let homePage: HomePage; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
// Create an instance of the PlaywrightHomePage class | ||
playwrightHomePage = new PlaywrightHomePage(page); | ||
// Create an instance of the HomePage class | ||
homePage = new HomePage(page); | ||
// Go to the home page of OSRD | ||
await playwrightHomePage.goToHomePage(); | ||
await homePage.goToHomePage(); | ||
}); | ||
|
||
test.afterEach(async () => { | ||
// Navigate back to the home page of OSRD | ||
await playwrightHomePage.backToHomePage(); | ||
await homePage.backToHomePage(); | ||
}); | ||
|
||
// Test that the home page of OSRD displays links to other pages | ||
test('should display links in the home page', async () => { | ||
await playwrightHomePage.getDisplayLinks(); | ||
await homePage.getDisplayLinks(); | ||
}); | ||
|
||
test('should be correctly redirected to the "Operational Studies" page after clicking on the link', async () => { | ||
// Navigate to the "Operational Studies" page | ||
await playwrightHomePage.goToOperationalStudiesPage(); | ||
await homePage.goToOperationalStudiesPage(); | ||
// Check that the URL of the page matches the expected pattern | ||
await expect(playwrightHomePage.page).toHaveURL(/.*\/operational-studies/); | ||
await expect(homePage.page).toHaveURL(/.*\/operational-studies/); | ||
}); | ||
|
||
test('should be correctly redirected to the "Map" page after clicking on the link', async () => { | ||
// Navigate to the "Map" page | ||
await playwrightHomePage.goToCartoPage(); | ||
await homePage.goToCartoPage(); | ||
|
||
// Check that the URL of the page matches the expected pattern | ||
await expect(playwrightHomePage.page).toHaveURL(/.*\/map/); | ||
await expect(homePage.page).toHaveURL(/.*\/map/); | ||
}); | ||
|
||
test('should be correctly redirected to the "Editor" page after clicking on the link', async () => { | ||
// Navigate to the "Editor" page | ||
await playwrightHomePage.goToEditorPage(); | ||
await homePage.goToEditorPage(); | ||
|
||
// Check that the URL of the page matches the expected pattern | ||
await expect(playwrightHomePage.page).toHaveURL(/.*\/editor\/*/); | ||
await expect(homePage.page).toHaveURL(/.*\/editor\/*/); | ||
}); | ||
|
||
test('should be correctly redirected to the "STDCM" page after clicking on the link', async () => { | ||
// Navigate to the "STDCM" page | ||
await playwrightHomePage.goToSTDCMPage(); | ||
await homePage.goToSTDCMPage(); | ||
|
||
// Check that the URL of the page matches the expected pattern | ||
await expect(playwrightHomePage.page).toHaveURL(/.*\/stdcm/); | ||
await expect(homePage.page).toHaveURL(/.*\/stdcm/); | ||
}); | ||
}); |
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
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
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
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
Oops, something went wrong.