Skip to content

Commit

Permalink
front: editor: testing infra editor e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
blemoineovh committed Jan 19, 2024
1 parent b874d01 commit 35b02c1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion front/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const config: PlaywrightTestConfig = {

/* select tags to run specific tests */
// TODO: remove grep when every tests are refactored
grep: [/home/, /project/, /study/, /scenario/],
grep: [/home/, /project/, /study/, /scenario/, /editor/],
};

export default config;
11 changes: 11 additions & 0 deletions front/tests/010-infra-editor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect, test } from '@playwright/test';
import { PlaywrightEditorPage } from './pages/infra-editor-page-model';

test.describe('Testing the Infra Editor app', () => {
test('Testing there is no error by default in the Editor', async ({ page }) => {
const playwrightEditorPage = new PlaywrightEditorPage(page);
await playwrightEditorPage.goToEditorPage();

await expect(playwrightEditorPage.getErrorBox).not.toBeVisible();
});
});
23 changes: 23 additions & 0 deletions front/tests/pages/infra-editor-page-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* tests setup for the infra editor page
*/

/* eslint-disable import/prefer-default-export */
import { Locator, Page } from '@playwright/test';

export class PlaywrightEditorPage {
// The current page object
readonly page: Page;

readonly getErrorBox: Locator;

constructor(page: Page) {
this.page = page;
this.getErrorBox = page.locator('.error-box');
}

// Navigate to the infra page
async goToEditorPage() {
await this.page.goto('/editor');
}
}

0 comments on commit 35b02c1

Please sign in to comment.