Skip to content

Commit

Permalink
Fix some flaky percy behavior (#7756)
Browse files Browse the repository at this point in the history
* update imagery to be static

* bump versions

* doesn't do anything

* does this do anything

* undo only

* update the hardcoded urls

* add ignore CI logs push

* downgrade to test

* update the package lock

* Add some more noise reduction

* move to elements tab so that there is no time-based component

* stability
  • Loading branch information
unlikelyzero authored Jun 25, 2024
1 parent 554f77c commit 448750c
Show file tree
Hide file tree
Showing 7 changed files with 295 additions and 270 deletions.
13 changes: 12 additions & 1 deletion e2e/.percy.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@ snapshot:
.gl-plot-chart-area{
opacity: 0 !important;
}
/* SWG Time values on plot */
.gl-plot-x{
opacity: 0 !important;
}
/* Notification Time in modal */
.c-ne__time{
opacity: 0 !important;
}
/* Snapshot name with embedded time */
.l-browse-bar__snapshot-datetime{
opacity: 0 !important;
}
14 changes: 13 additions & 1 deletion e2e/.percy.nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ snapshot:
/* Chart Area for Plots */
.gl-plot-chart-area{
opacity: 0 !important;
}
}
/* SWG Time values on plot */
.gl-plot-x{
opacity: 0 !important;
}
/* Notification Time in modal */
.c-ne__time{
opacity: 0 !important;
}
/* Snapshot name with embedded time */
.l-browse-bar__snapshot-datetime{
opacity: 0 !important;
}
3 changes: 1 addition & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
}
},
"scripts": {
"pretest:visual": "npm install",
"test": "npx playwright test",
"test:visual": "percy exec"
},
Expand All @@ -24,4 +23,4 @@
},
"author": "NASA Ames Research Center",
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion e2e/playwright-visual-a11y.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
cwd: fileURLToPath(new URL('../', import.meta.url)), // Provide cwd for the root of the project
url: 'http://localhost:8080/#',
timeout: 200 * 1000,
reuseExistingServer: !process.env.CI
reuseExistingServer: true //This was originally disabled to prevent differences in local debugging vs. CI. However, it significantly speeds up local debugging.
},
use: {
baseURL: 'http://localhost:8080/',
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/visual-a11y/displayLayout.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ test.describe('Visual - Display Layout @clock', () => {
});
await page.getByLabel('Expand Inspect Pane').click();
await page.getByLabel('Resize Inspect Pane').dragTo(page.getByLabel('X:'));
await page.getByRole('tab', { name: 'Elements' }).click();
await percySnapshot(page, `Toolbar does not overflow into inspector (theme: '${theme}')`);
});
});
7 changes: 4 additions & 3 deletions e2e/tests/visual-a11y/imagery.visual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

import percySnapshot from '@percy/playwright';

import { createDomainObjectWithDefaults, setRealTimeMode } from '../../appActions.js';
Expand All @@ -45,17 +44,19 @@ test.describe('Visual - Example Imagery', () => {
parent: parentLayout.uuid
});

// Modify Example Imagery to create a really stable Example Imagery
// Modify Example Imagery to create a really stable image which will never let us down
await page.goto(exampleImagery.url, { waitUntil: 'domcontentloaded' });
await page.getByRole('button', { name: 'More actions' }).click();
await page.getByRole('menuitem', { name: 'Edit Properties...' }).click();
await page
.locator('#imageLocation-textarea')
.fill(
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg,https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg'
'https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg,https://raw.githubusercontent.com/nasa/openmct/554f77c42fec81cf0f63e62b278012cb08d82af9/e2e/test-data/rick.jpg'
);
await page.getByRole('button', { name: 'Save' }).click();
await page.reload({ waitUntil: 'domcontentloaded' });

//Hide the Browse and Inspect panes to make the image more stable
await page.getByTitle('Collapse Browse Pane').click();
await page.getByTitle('Collapse Inspect Pane').click();
});
Expand Down
Loading

0 comments on commit 448750c

Please sign in to comment.