Skip to content

Commit

Permalink
feat: fix playwrght tests (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaZhem authored Jul 30, 2024
1 parent cdabf14 commit 99f139f
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions apps/taiga-lumbermill-e2e/src/cleaning/cleaning.spec.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
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');

await expect(title).toBeVisible();
});

test('Have 1 cleaning date', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const inputs = page.locator('tui-input-date');

await expect(inputs).toHaveCount(1);
});

test('Can add new cleaning date', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const inputs = page.locator('tui-input-date');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
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');

await expect(title).toBeVisible();
});

test('Have 3 inputs', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const inputs = page.locator('tui-input-number');

await expect(inputs).toHaveCount(3);
});

test('Have right names', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const inputs = page.locator('tui-input-number');

Expand All @@ -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();

Expand All @@ -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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
4 changes: 2 additions & 2 deletions apps/taiga-lumbermill-e2e/src/cost/cost.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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');

await expect(title).toBeVisible();
});

test('Have bar chart', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const chart = page.locator('tui-bar-chart');

Expand Down
6 changes: 3 additions & 3 deletions apps/taiga-lumbermill-e2e/src/electricity/electricity.spec.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand All @@ -17,15 +17,15 @@ 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');

await expect(chart).toHaveCount(1);
});

test('Can open modal info', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const chart = page.locator('tui-line-days-chart').first();

Expand Down
2 changes: 1 addition & 1 deletion apps/taiga-lumbermill-e2e/src/example.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
4 changes: 2 additions & 2 deletions apps/taiga-lumbermill-e2e/src/lighting/lighting.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {expect, test} from '@playwright/test';

test('component Availability', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const title = page.getByText('Lighting');

await expect(title).toBeVisible();
});

test('Can change lighting status', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const checked = page.locator('.checked');

Expand Down
4 changes: 2 additions & 2 deletions apps/taiga-lumbermill-e2e/src/safety/safety.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {expect, test} from '@playwright/test';

test('component Availability', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const title = page.getByText('Safety');

await expect(title).toBeVisible();
});

test('Can change lighting status', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const inputs = page.locator('lmb-safety').locator('input');

Expand Down
4 changes: 2 additions & 2 deletions apps/taiga-lumbermill-e2e/src/weather/weather.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {expect, test} from '@playwright/test';

test('component Availability', async ({page}) => {
await page.goto('/');
await page.goto('/dashboards/iot');

const title = page.getByText('Weather');

await expect(title).toBeVisible();
});

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]');

Expand Down

0 comments on commit 99f139f

Please sign in to comment.