Apply test ids to production builds for usage in e2e tests (#1499)

Our e2e tests get executed against production builds and therefore need access to the test-ids. Prior to this change, test-ids were removed in prod builds.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Konstantin Schaper
2021-01-25 12:49:19 +01:00
committed by GitHub
parent 01fd83fd6b
commit 36b4a849e2
2 changed files with 3 additions and 1 deletions

View File

@@ -22,11 +22,12 @@
* SOFTWARE.
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore scmStage is set on the index page
export const isDevBuild = () => (window.scmStage || "").toUpperCase() === "DEVELOPMENT";
export const createAttributesForTesting = (testId?: string) => {
if (!testId || !isDevBuild()) {
if (!testId) {
return undefined;
}
return {