mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[UX Dashboard] Make core web vitals test more reliable (#134401)
* Make core web vitals test more reliable. * Remove strict numeric comparison from test. * Fix regex string. * Remove unneeded explicit timeout value.
This commit is contained in:
parent
d72a08378c
commit
24312e7eda
2 changed files with 6 additions and 10 deletions
|
@ -88,7 +88,7 @@ async function updateUser({
|
|||
const hasAllRoles = difference(allRoles, existingUser.roles).length === 0;
|
||||
if (hasAllRoles) {
|
||||
console.log(
|
||||
`Skipping: User "${username}" already has neccesarry roles: "${newUser.roles}"`
|
||||
`Skipping: User "${username}" already has necessary roles: "${newUser.roles}"`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -42,15 +42,11 @@ journey('Core Web Vitals', async ({ page, params }) => {
|
|||
expect(await page.$('text=Largest contentful paint'));
|
||||
expect(await page.$('text=First input delay'));
|
||||
expect(await page.$('text=Cumulative layout shift'));
|
||||
const cwvSummary = await page.innerText('text=traffic represented');
|
||||
expect(
|
||||
await page.innerText('text=1.93 s', {
|
||||
strict: true,
|
||||
timeout: 29000,
|
||||
})
|
||||
).toEqual('1.93 s');
|
||||
expect(await page.innerText('text=5 ms', { strict: true })).toEqual('5 ms');
|
||||
expect(await page.innerText('text=0.003', { strict: true })).toEqual(
|
||||
'0.003'
|
||||
);
|
||||
// match any three digits followed by string constant
|
||||
// note this regex is suceptible to accepting values > 100
|
||||
new RegExp('[0-9]{1,3}% of the traffic represented').test(cwvSummary)
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue