Skip to content

Commit

Permalink
e2eTests: changed getScreenshotName to replace invalid path character…
Browse files Browse the repository at this point in the history
…s with '_'.

This currently only affects one file and fixes it so generated screenshot will now match the reference screenshot: end-to-end-test/remote/screenshots/reference/download_tab_-_nsclc_tcga_broad_2016_for_query_egfr:_mut=t790m_amp_element_chrome_1600x1000.png

NOTE: there are four other files that previously had invalid path characters, but they have already been renamed and the tests already updated
  • Loading branch information
pappde committed Jun 25, 2024
1 parent 780bb9e commit 6342e03
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions end-to-end-test/shared/wdio/getScreenshotName.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ module.exports = function getScreenshotName(basePath, browserName) {
var browserWidth = browserViewport.width;
var browserHeight = browserViewport.height;

// regular expression that matches invalid path characters for some systems (such as Windows)
var invalidChars = /[<>:"\/\\|?*]/g;

return path.join(
basePath,
`${testName}_element_chrome_1600x1000.png`
.toLowerCase()
.replace(/ /g, '_')
.replace(invalidChars, '_')
);
};
};

0 comments on commit 6342e03

Please sign in to comment.