-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WRQ-16517: Sync develop and master branch (#85)
* WRQ-8596: Adapt performanceMetrics app for Agate performance tests (#81) * added performance tests for agate components * code review fixes * Adapted performanceMetrics app for Agate test results * code review fixes * fixed urls for performanceMetrics * WRQ-11737: Added performance tests for agate overall view + fixes for other tests (#82) * avoided unnecessary api call when the theme library is changed in poerformanceMetrics * Added overallView for Agate Fixed lint warnings for latest enact/cli Fixed placeholder images link * Added tests for agate/overallview Solved lint warnings * modified marquee test in order to fix the tests on jenkins * revert for marquee test * fix for marquee test * fix for sandstone/marquee test * fixed tests for agate/Slider, agate/IncrementSlider, sandstone/Slider and sandstone/Panels * fixed tests for agate/Panels * code review fixes * WRQ-14123: Fixed performanceMetrics when same component is selected once more. Fixed tests where results were saved in the wrong file (#83) * fixed performanceMetrics when same component is selected once more. Fixed tests where the tests results were saved in the wrong file * Fixed performance tests where the metric name was incorrect * Added missing component options in performance metrics dropdown * WRQ-16517: Updated dependencies to fix critical vulnerabilities (#84) * updated dependencies to fix vulnerabilities * fixed quickguidepanel test view
- Loading branch information
1 parent
b001733
commit 464caf1
Showing
39 changed files
with
1,381 additions
and
776 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
/* global CPUThrottling, page, minFPS, maxFID, maxCLS, stepNumber, maxDCL, maxFCP, maxLCP, passRatio, serverAddr, targetEnv */ | ||
|
||
const TestResults = require('../../TestResults'); | ||
const {CLS, FID, FPS, getAverageFPS, PageLoadingMetrics} = require('../../TraceModel'); | ||
const {clsValue, firstInputValue, getFileName, newPageMultiple} = require('../../utils'); | ||
|
||
describe('OverallView', () => { | ||
const component = 'Overall'; | ||
TestResults.newFile(component); | ||
|
||
it('FPS', async () => { | ||
await FPS(); | ||
await page.goto(`http://${serverAddr}/overallView`); | ||
await page.waitForSelector('#tooltipButton'); | ||
await page.click('[aria-label="Next Tab"]'); // to move to the next panel. | ||
await page.waitForSelector('#virtualGridListSecond'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
await page.click(('[aria-label="Previous Tab"]')); // to move to the previous tab. | ||
await page.waitForSelector('#tooltipButton'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
|
||
await page.click('#tooltipButton'); // to move to the next panel. | ||
await page.waitForSelector('#virtualGridListSecond'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
await page.click(('[aria-label="Previous Tab"]')); // to move to the previous tab. | ||
await page.waitForSelector('#tooltipButton'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
|
||
// focus various spottable components in the first tab and force the scroller to move | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowDown'); | ||
await page.keyboard.up('ArrowDown'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowRight'); | ||
await page.keyboard.up('ArrowRight'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowRight'); | ||
await page.keyboard.up('ArrowRight'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowRight'); | ||
await page.keyboard.up('ArrowRight'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowRight'); | ||
await page.keyboard.up('ArrowRight'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowUp'); | ||
await page.keyboard.up('ArrowUp'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowUp'); | ||
await page.keyboard.up('ArrowUp'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowUp'); | ||
await page.keyboard.up('ArrowUp'); | ||
await new Promise(r => setTimeout(r, 100)); | ||
await page.keyboard.down('ArrowUp'); | ||
await page.keyboard.up('ArrowUp'); | ||
|
||
const averageFPS = await getAverageFPS(); | ||
TestResults.addResult({component: component, type: 'FPS', actualValue: Math.round((averageFPS + Number.EPSILON) * 1000) / 1000}); | ||
|
||
expect(averageFPS).toBeGreaterThan(minFPS); | ||
}); | ||
|
||
it('should have a good FID and CLS', async () => { | ||
await page.evaluateOnNewDocument(FID); | ||
await page.evaluateOnNewDocument(CLS); | ||
await page.goto(`http://${serverAddr}/overallView`); | ||
await page.waitForSelector('#tooltipButton'); | ||
await page.click('[aria-label="Next Tab"]'); // to move to the next tab. | ||
await page.waitForSelector('#virtualGridListSecond'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
await page.click(('[aria-label="Previous Tab"]')); // to move to the previous tab. | ||
await page.waitForSelector('#tooltipButton'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
|
||
let actualFirstInput = await firstInputValue(); | ||
let actualCLS = await clsValue(); | ||
|
||
TestResults.addResult({component: component, type: 'FID', actualValue: Math.round((actualFirstInput + Number.EPSILON) * 1000) / 1000}); | ||
TestResults.addResult({component: component, type: 'CLS', actualValue: Math.round((actualCLS + Number.EPSILON) * 1000) / 1000}); | ||
|
||
expect(actualFirstInput).toBeLessThan(maxFID); | ||
expect(actualCLS).toBeLessThan(maxCLS); | ||
}); | ||
|
||
it('should have a good DCL, FCP and LCP', async () => { | ||
const filename = getFileName(component); | ||
|
||
let passContDCL = 0; | ||
let passContFCP = 0; | ||
let passContLCP = 0; | ||
let avgDCL = 0; | ||
let avgFCP = 0; | ||
let avgLCP = 0; | ||
for (let step = 0; step < stepNumber; step++) { | ||
const overallViewPage = targetEnv === 'TV' ? page : await newPageMultiple(); | ||
await overallViewPage.emulateCPUThrottling(CPUThrottling); | ||
|
||
await overallViewPage.tracing.start({path: filename, screenshots: false}); | ||
await overallViewPage.goto(`http://${serverAddr}/overallView`); | ||
await overallViewPage.waitForSelector('#virtualGridList'); | ||
await new Promise(r => setTimeout(r, 200)); | ||
|
||
await overallViewPage.tracing.stop(); | ||
|
||
const {actualDCL, actualFCP, actualLCP} = PageLoadingMetrics(filename); | ||
|
||
avgDCL = avgDCL + actualDCL; | ||
if (actualDCL < maxDCL) { | ||
passContDCL += 1; | ||
} | ||
|
||
avgFCP = avgFCP + actualFCP; | ||
if (actualFCP < maxFCP) { | ||
passContFCP += 1; | ||
} | ||
|
||
avgLCP = avgLCP + actualLCP; | ||
if (actualLCP < maxLCP) { | ||
passContLCP += 1; | ||
} | ||
|
||
if (targetEnv === 'PC') await overallViewPage.close(); | ||
} | ||
avgDCL = avgDCL / stepNumber; | ||
avgFCP = avgFCP / stepNumber; | ||
avgLCP = avgLCP / stepNumber; | ||
|
||
TestResults.addResult({component: component, type: 'DCL', actualValue: Math.round((avgDCL + Number.EPSILON) * 1000) / 1000}); | ||
TestResults.addResult({component: component, type: 'FCP', actualValue: Math.round((avgFCP + Number.EPSILON) * 1000) / 1000}); | ||
TestResults.addResult({component: component, type: 'LCP', actualValue: Math.round((avgLCP + Number.EPSILON) * 1000) / 1000}); | ||
|
||
expect(passContDCL).toBeGreaterThan(passRatio * stepNumber); | ||
expect(avgDCL).toBeLessThan(maxDCL); | ||
|
||
expect(passContFCP).toBeGreaterThan(passRatio * stepNumber); | ||
expect(avgFCP).toBeLessThan(maxFCP); | ||
|
||
expect(passContLCP).toBeGreaterThan(passRatio * stepNumber); | ||
expect(avgLCP).toBeLessThan(maxLCP); | ||
}); | ||
}); | ||
|
Oops, something went wrong.