mirror of
https://github.com/penpot/penpotqa.git
synced 2024-07-06 04:51:46 +00:00
add imposter performance measures
This commit is contained in:
parent
e6b0881154
commit
626468f83f
|
@ -9,7 +9,7 @@ exports.LoginPage = class LoginPage extends BasePage {
|
|||
this.pageTitle = page.locator('h1[data-test="login-title"]');
|
||||
this.emailInput = page.locator("#email");
|
||||
this.pwdInput = page.locator("#password");
|
||||
this.loginButton = page.locator('input[name="submit"]');
|
||||
this.loginButton = page.locator('[data-test="login-submit"]');
|
||||
this.emailInputError = page.locator(
|
||||
'div[class=" invalid with-icon custom-input"] #email'
|
||||
);
|
||||
|
|
28
tests/performance/thumbnail.spec.js
Normal file
28
tests/performance/thumbnail.spec.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { expect } from "@playwright/test";
|
||||
import { performanceTest } from "../../fixtures.js";
|
||||
import { PerformancePage } from "../../pages/performance-page";
|
||||
|
||||
performanceTest("PERF Thumbnail renderer", async ({ page }) => {
|
||||
const performancePage = new PerformancePage(page);
|
||||
await performancePage.setup();
|
||||
|
||||
// TODO: Medir el tiempo que tarda en renderizar el thumbnail.
|
||||
|
||||
const content = page.locator(".frame-container > .frame-content");
|
||||
await content.waitFor()
|
||||
performance.mark('imposter:start')
|
||||
|
||||
const imposter = page.locator(".frame-container > .frame-imposter");
|
||||
await imposter.waitFor()
|
||||
performance.mark('imposter:end')
|
||||
|
||||
const measure = performance.measure('imposter', 'imposter:start', 'imposter:end')
|
||||
console.log(measure.duration, measure.entryType, measure.name)
|
||||
|
||||
const [averageFrameRate, averageLongTaskDuration] =
|
||||
await performancePage.measure();
|
||||
|
||||
expect(averageFrameRate).toBeGreaterThan(55);
|
||||
expect(averageFrameRate).toBeLessThan(65);
|
||||
expect(averageLongTaskDuration).toBeLessThan(0.5);
|
||||
})
|
Loading…
Reference in New Issue
Block a user