parent
01b7ba563f
commit
cd949edfdc
|
@ -1,38 +1,26 @@
|
||||||
import { test, expect } from "@playwright/test";
|
import { test, expect } from '@playwright/test';
|
||||||
import { login } from "./login";
|
import { login } from './login';
|
||||||
|
|
||||||
test.beforeEach(login("/"));
|
test.beforeEach(login('/'));
|
||||||
|
|
||||||
test.describe("Open", () => {
|
test.describe('Open', () => {
|
||||||
test("Look for Images", async ({ page }) => {
|
test('Look for Images', async ({ page }) => {
|
||||||
expect(
|
expect(await page.locator('img[src*="core/preview"]').count(), 'Number of previews').toBeGreaterThan(4);
|
||||||
await page.locator('img[src*="core/preview"]').count(),
|
|
||||||
"Number of previews"
|
|
||||||
).toBeGreaterThan(4);
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Open one image", async ({ page }) => {
|
test('Open one image', async ({ page }) => {
|
||||||
await page
|
await page.locator('div:nth-child(2) > .p-outer > .img-outer > img').first().click();
|
||||||
.locator("div:nth-child(2) > .p-outer > .img-outer > img")
|
|
||||||
.first()
|
|
||||||
.click();
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForTimeout(1000);
|
||||||
await page.locator("button.header-close").first().click();
|
await page.locator('button.header-close').first().click();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Select two images and delete", async ({ page }) => {
|
test('Select two images and delete', async ({ page }) => {
|
||||||
const i1 = "div:nth-child(2) > div:nth-child(1) > .p-outer";
|
const i1 = "div:nth-child(2) > div:nth-child(1) > .p-outer";
|
||||||
const i2 = "div:nth-child(2) > div:nth-child(2) > .p-outer";
|
const i2 = "div:nth-child(2) > div:nth-child(2) > .p-outer";
|
||||||
|
|
||||||
const src1 = await page
|
const src1 = await page.locator(`${i1} > .img-outer > img`).first().getAttribute('src');
|
||||||
.locator(`${i1} > .img-outer > img`)
|
const src2 = await page.locator(`${i2} > .img-outer > img`).first().getAttribute('src');
|
||||||
.first()
|
|
||||||
.getAttribute("src");
|
|
||||||
const src2 = await page
|
|
||||||
.locator(`${i2} > .img-outer > img`)
|
|
||||||
.first()
|
|
||||||
.getAttribute("src");
|
|
||||||
|
|
||||||
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(1);
|
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(1);
|
||||||
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(1);
|
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(1);
|
||||||
|
@ -49,9 +37,9 @@ test.describe("Open", () => {
|
||||||
|
|
||||||
// refresh page
|
// refresh page
|
||||||
await page.reload();
|
await page.reload();
|
||||||
await page.waitForTimeout(15000); // cache
|
await page.waitForTimeout(4000); // cache
|
||||||
await page.waitForSelector('img[src*="core/preview"]');
|
await page.waitForSelector('img[src*="core/preview"]');
|
||||||
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(0);
|
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(0);
|
||||||
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(0);
|
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in New Issue