🚨(i18n) add linter to i18n package
We need to add a linter to the i18n package, we are mainly interested by the jest linting rules so we create a jest eslint config pluggable our other configs and to the i18n eslint config.
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
import { keyCloakSignIn } from "./common";
|
||||
import { keyCloakSignIn } from './common';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.goto('/');
|
||||
await keyCloakSignIn(page);
|
||||
});
|
||||
|
||||
test.describe("App", () => {
|
||||
test("should display the main elements", async ({ page }) => {
|
||||
await expect(page.locator("header").first()).toContainText("Desk");
|
||||
await expect(page.getByLabel("Team name")).toBeVisible();
|
||||
test.describe('App', () => {
|
||||
test('should display the main elements', async ({ page }) => {
|
||||
await expect(page.locator('header').first()).toContainText('Desk');
|
||||
await expect(page.getByLabel('Team name')).toBeVisible();
|
||||
});
|
||||
|
||||
test("creates 2 teams and displayed them", async ({ page }) => {
|
||||
await page.getByLabel("Team name").fill("My new team");
|
||||
test('creates 2 teams and displayed them', async ({ page }) => {
|
||||
await page.getByLabel('Team name').fill('My new team');
|
||||
await page.click('button:has-text("Create Team")');
|
||||
await page.getByLabel("Team name").fill("My second new team");
|
||||
await page.getByLabel('Team name').fill('My second new team');
|
||||
await page.click('button:has-text("Create Team")');
|
||||
|
||||
await expect(
|
||||
page.locator("li").getByText("My new team").first(),
|
||||
page.locator('li').getByText('My new team').first(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.locator("li").getByText("My second new team").first(),
|
||||
page.locator('li').getByText('My second new team').first(),
|
||||
).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Page } from "@playwright/test";
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export const keyCloakSignIn = async (page: Page) => {
|
||||
const title = await page.locator("h1").first().textContent({
|
||||
const title = await page.locator('h1').first().textContent({
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
if (title?.includes("Sign in to your account")) {
|
||||
await page.getByRole("textbox", { name: "username" }).fill("user-e2e");
|
||||
await page.getByRole("textbox", { name: "password" }).fill("password-e2e");
|
||||
if (title?.includes('Sign in to your account')) {
|
||||
await page.getByRole('textbox', { name: 'username' }).fill('user-e2e');
|
||||
await page.getByRole('textbox', { name: 'password' }).fill('password-e2e');
|
||||
|
||||
await page.click('input[type="submit"]');
|
||||
}
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
import { keyCloakSignIn } from "./common";
|
||||
import { keyCloakSignIn } from './common';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.goto('/');
|
||||
await keyCloakSignIn(page);
|
||||
});
|
||||
|
||||
test.describe("Header", () => {
|
||||
test("checks all the elements are visible", async ({ page }) => {
|
||||
const header = page.locator("header").first();
|
||||
test.describe('Header', () => {
|
||||
test('checks all the elements are visible', async ({ page }) => {
|
||||
const header = page.locator('header').first();
|
||||
|
||||
await expect(header.getByAltText("Marianne Logo")).toBeVisible();
|
||||
await expect(header.getByAltText('Marianne Logo')).toBeVisible();
|
||||
|
||||
await expect(
|
||||
header.getByAltText("Freedom Equality Fraternity Logo"),
|
||||
header.getByAltText('Freedom Equality Fraternity Logo'),
|
||||
).toBeVisible();
|
||||
|
||||
await expect(header.getByAltText("Desk Logo")).toBeVisible();
|
||||
await expect(header.locator("h2").getByText("Desk")).toHaveCSS(
|
||||
"color",
|
||||
"rgb(0, 0, 145)",
|
||||
await expect(header.getByAltText('Desk Logo')).toBeVisible();
|
||||
await expect(header.locator('h2').getByText('Desk')).toHaveCSS(
|
||||
'color',
|
||||
'rgb(0, 0, 145)',
|
||||
);
|
||||
await expect(header.locator("h2").getByText("Desk")).toHaveCSS(
|
||||
"font-family",
|
||||
"marianne",
|
||||
await expect(header.locator('h2').getByText('Desk')).toHaveCSS(
|
||||
'font-family',
|
||||
'marianne',
|
||||
);
|
||||
|
||||
await expect(
|
||||
header.getByRole("button", { name: "Access to FAQ" }),
|
||||
header.getByRole('button', { name: 'Access to FAQ' }),
|
||||
).toBeVisible();
|
||||
await expect(header.getByAltText("FAQ Icon")).toBeVisible();
|
||||
await expect(header.getByText("FAQ")).toBeVisible();
|
||||
await expect(header.getByAltText('FAQ Icon')).toBeVisible();
|
||||
await expect(header.getByText('FAQ')).toBeVisible();
|
||||
|
||||
await expect(header.getByAltText("Cells icon")).toBeVisible();
|
||||
await expect(header.getByAltText('Cells icon')).toBeVisible();
|
||||
|
||||
await expect(header.getByAltText("Language Icon")).toBeVisible();
|
||||
await expect(header.getByAltText('Language Icon')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
import { keyCloakSignIn } from "./common";
|
||||
import { keyCloakSignIn } from './common';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.goto('/');
|
||||
await keyCloakSignIn(page);
|
||||
});
|
||||
|
||||
test.describe("Language", () => {
|
||||
test("checks translation library works", async ({ page }) => {
|
||||
test.describe('Language', () => {
|
||||
test('checks translation library works', async ({ page }) => {
|
||||
await expect(
|
||||
page.locator("h1").first().getByText("Bienvenue sur Desk !"),
|
||||
page.locator('h1').first().getByText('Bienvenue sur Desk !'),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("checks the language picker", async ({ page }) => {
|
||||
const header = page.locator("header").first();
|
||||
test('checks the language picker', async ({ page }) => {
|
||||
const header = page.locator('header').first();
|
||||
|
||||
await header.getByRole("combobox").getByText("FR").click();
|
||||
await header.getByRole("option", { name: "Language Icon EN" }).click();
|
||||
await expect(header.getByRole("combobox").getByText("EN")).toBeVisible();
|
||||
await header.getByRole('combobox').getByText('FR').click();
|
||||
await header.getByRole('option', { name: 'Language Icon EN' }).click();
|
||||
await expect(header.getByRole('combobox').getByText('EN')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user