From 99f139f7a5105500574737a7b5759bf2a514636c Mon Sep 17 00:00:00 2001 From: Michael <85116490+MishaZhem@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:11:53 +0300 Subject: [PATCH] feat: fix playwrght tests (#71) --- .../taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts | 6 +++--- .../src/climate-control/climate-control.spec.ts | 10 +++++----- .../src/control-panel/control-panel.spec.ts | 2 +- apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts | 4 ++-- .../src/electricity/electricity.spec.ts | 6 +++--- apps/taiga-lumbermill-e2e/src/example.spec.ts | 2 +- .../taiga-lumbermill-e2e/src/lighting/lighting.spec.ts | 4 ++-- apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts | 4 ++-- apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts b/apps/taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts index 577e4389c..bcb009354 100644 --- a/apps/taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Cleaning schedule'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Have 1 cleaning date', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-date'); @@ -17,7 +17,7 @@ test('Have 1 cleaning date', async ({page}) => { }); test('Can add new cleaning date', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-date'); diff --git a/apps/taiga-lumbermill-e2e/src/climate-control/climate-control.spec.ts b/apps/taiga-lumbermill-e2e/src/climate-control/climate-control.spec.ts index 462e1a12e..3c4b45fe6 100644 --- a/apps/taiga-lumbermill-e2e/src/climate-control/climate-control.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/climate-control/climate-control.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Climate control'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Have 3 inputs', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-number'); @@ -17,7 +17,7 @@ test('Have 3 inputs', async ({page}) => { }); test('Have right names', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-number'); @@ -27,7 +27,7 @@ test('Have right names', async ({page}) => { }); test('Numbers can increase', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-number'); const button = inputs.nth(0).locator('button').first(); @@ -39,7 +39,7 @@ test('Numbers can increase', async ({page}) => { }); test('Numbers can decrease', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('tui-input-number'); const button = inputs.nth(0).locator('button').last(); diff --git a/apps/taiga-lumbermill-e2e/src/control-panel/control-panel.spec.ts b/apps/taiga-lumbermill-e2e/src/control-panel/control-panel.spec.ts index 08339c449..12c2d5849 100644 --- a/apps/taiga-lumbermill-e2e/src/control-panel/control-panel.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/control-panel/control-panel.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('Have 5 cards', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const cards = page.locator('.button-card'); diff --git a/apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts b/apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts index 94c67a932..f26332385 100644 --- a/apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Utility costs'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Have bar chart', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const chart = page.locator('tui-bar-chart'); diff --git a/apps/taiga-lumbermill-e2e/src/electricity/electricity.spec.ts b/apps/taiga-lumbermill-e2e/src/electricity/electricity.spec.ts index 20ce8e127..f944bf316 100644 --- a/apps/taiga-lumbermill-e2e/src/electricity/electricity.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/electricity/electricity.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('Can change date', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const calendar = page.locator('tui-calendar').first(); @@ -17,7 +17,7 @@ test('Can change date', async ({page}) => { }); test('Have line chart', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const chart = page.locator('tui-line-days-chart'); @@ -25,7 +25,7 @@ test('Have line chart', async ({page}) => { }); test('Can open modal info', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const chart = page.locator('tui-line-days-chart').first(); diff --git a/apps/taiga-lumbermill-e2e/src/example.spec.ts b/apps/taiga-lumbermill-e2e/src/example.spec.ts index 4eacafdd7..f9233df67 100644 --- a/apps/taiga-lumbermill-e2e/src/example.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/example.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('has title', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); // Expect h2 to contain a substring. expect(await page.locator('h2').first().innerText()).toContain('Safety'); diff --git a/apps/taiga-lumbermill-e2e/src/lighting/lighting.spec.ts b/apps/taiga-lumbermill-e2e/src/lighting/lighting.spec.ts index a1cfc12e5..6410ea449 100644 --- a/apps/taiga-lumbermill-e2e/src/lighting/lighting.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/lighting/lighting.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Lighting'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Can change lighting status', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const checked = page.locator('.checked'); diff --git a/apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts b/apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts index de0d5963e..3cdbb6fe3 100644 --- a/apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Safety'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Can change lighting status', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const inputs = page.locator('lmb-safety').locator('input'); diff --git a/apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts b/apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts index 3133eeb67..3ab9eb2f7 100644 --- a/apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts +++ b/apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts @@ -1,7 +1,7 @@ import {expect, test} from '@playwright/test'; test('component Availability', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const title = page.getByText('Weather'); @@ -9,7 +9,7 @@ test('component Availability', async ({page}) => { }); test('Component got the data from the api', async ({page}) => { - await page.goto('/'); + await page.goto('/dashboards/iot'); const city = page.locator('lmb-weather').locator('.left-side').locator('[tuiTitle]');