tests(devtools): sync web tests (#14061)
This commit is contained in:
Родитель
525116472f
Коммит
220d9cf3e9
|
@ -51,8 +51,8 @@ jobs:
|
|||
# 3) every change to file in Lighthouse repo important to running these tests.
|
||||
#
|
||||
# The number is how many times this hash key was manually updated to break the cache.
|
||||
key: ${{ runner.os }}-3-${{ env.WEEK_OF_THE_YEAR }}-${{ hashFiles('cdt-test-hash.txt') }}
|
||||
restore-keys: ${{ runner.os }}-
|
||||
key: ${{ runner.os }}-5-${{ env.WEEK_OF_THE_YEAR }}-${{ hashFiles('cdt-test-hash.txt') }}
|
||||
restore-keys: ${{ runner.os }}-5
|
||||
- name: Set GHA_DEVTOOLS_CACHE_HIT
|
||||
if: steps.devtools-cache.outputs.cache-hit == 'true'
|
||||
run: echo "GHA_DEVTOOLS_CACHE_HIT=1" >> $GITHUB_ENV
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Accessibility', 'Best practices', 'SEO', 'Progressive Web App'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,16 +15,14 @@
|
|||
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Accessibility', 'Best practices', 'SEO', 'Progressive Web App'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,12 +10,17 @@
|
|||
await TestRunner.showPanel('lighthouse');
|
||||
|
||||
const dialogElement = LighthouseTestRunner.getContainerElement();
|
||||
dialogElement.querySelector('input[name="lighthouse.device_type"][value="desktop"]').click();
|
||||
|
||||
// Turn off simulated throttling.
|
||||
dialogElement.querySelector('.lighthouse-settings-pane > div')
|
||||
.shadowRoot.querySelectorAll('span')[2]
|
||||
.shadowRoot.querySelector('input')
|
||||
.click();
|
||||
const select = dialogElement.querySelector('.lighthouse-settings-pane .toolbar')
|
||||
.shadowRoot.querySelector('select')
|
||||
select.querySelector('option[value="devtools"]').selected = true;
|
||||
|
||||
// Change event is not emitted automatically when updating select element programatically.
|
||||
select.dispatchEvent(new Event('change'));
|
||||
|
||||
// Use desktop environment
|
||||
dialogElement.querySelector('input[name="lighthouse.device_type"][value="desktop"]').click();
|
||||
|
||||
LighthouseTestRunner.dumpStartAuditState();
|
||||
LighthouseTestRunner.getRunButton().click();
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Accessibility', 'Best practices', 'SEO', 'Progressive Web App'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Performance', 'Accessibility', 'Best practices', 'SEO'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,22 +23,19 @@
|
|||
LighthouseTestRunner.openStartAudit();
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Performance', 'Accessibility', 'Best practices', 'SEO', 'Progressive Web App'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
LighthouseTestRunner.dumpStartAuditState();
|
||||
|
||||
TestRunner.addResult('\n\n**Allows audit with a single category**');
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== 'Performance') {
|
||||
continue;
|
||||
|
|
|
@ -11,16 +11,14 @@
|
|||
|
||||
const containerElement = LighthouseTestRunner.getContainerElement();
|
||||
const ensureDisabledNames = ['Accessibility', 'Best practices', 'SEO', 'Progressive Web App'];
|
||||
for (const checkboxName of ensureDisabledNames) {
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (checkbox.textElement.textContent !== checkboxName) {
|
||||
continue;
|
||||
}
|
||||
const checkboxes = Array.from(containerElement.querySelectorAll('.checkbox'));
|
||||
for (const checkbox of checkboxes) {
|
||||
if (!ensureDisabledNames.includes(checkbox.textElement.textContent)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
if (checkbox.checkboxElement.checked) {
|
||||
checkbox.checkboxElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that Lighthouse block requests specified in DevTools BlockedURLsPane.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
Requests made: http://127.0.0.1:8000/devtools/lighthouse/resources/lighthouse-basic.html
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that Lighthouse panel displays a warning when important data may affect pe
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
Warning Text: There may be stored data affecting loading performance in these locations: Web SQL, IndexedDB. Audit this page in an incognito window to prevent those resources from affecting your scores.
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that mobile emulation works.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Lighthouse Results ===============
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that lighthouse panel passes flags.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[ ] Simulated throttling
|
||||
Throttling method: devtools
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Lighthouse Results ===============
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that Lighthouse report is translated.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
resolved to locale es
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that audits panel works when only the pwa category is selected.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Audits run ===============
|
||||
|
|
|
@ -13,7 +13,7 @@ Tests that audits panel prevents run of unauditable pages.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Help text: At least one category must be selected.
|
||||
Analyze page load: disabled visible
|
||||
|
||||
|
@ -29,7 +29,7 @@ Analyze page load: disabled visible
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ Analyze page load: enabled visible
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ URL: about:blank
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Help text: Can only audit HTTP/HTTPS pages and Chrome extensions. Navigate to a different page to start an audit.
|
||||
Analyze page load: disabled visible
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that navigation mode works correctly.
|
|||
[x] Publisher Ads
|
||||
[ ] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Lighthouse Status Updates ===============
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that audits panel works.
|
|||
[x] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Lighthouse Status Updates ===============
|
||||
|
|
|
@ -10,7 +10,7 @@ Tests that audits panel renders View Trace button.
|
|||
[ ] Publisher Ads
|
||||
[x] Legacy navigation
|
||||
[x] Clear storage
|
||||
[x] Simulated throttling
|
||||
Throttling method: simulate
|
||||
Analyze page load: enabled visible
|
||||
|
||||
=============== Audits run ===============
|
||||
|
|
Загрузка…
Ссылка в новой задаче