Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

[terra-functional-testing] Add cloudRegion as a namespace for screenshot directories #657

Closed
yuderekyu opened this issue May 19, 2021 · 0 comments · Fixed by #660
Closed
Assignees
Labels
📦 terra-functional-testing Size: 3 Story Up Next - KC Issues that are ready to pull into an iteration for the KC team
Milestone

Comments

@yuderekyu
Copy link
Contributor

Feature Request

As a developer, when using orion-full-stack-testing, I want to not overwrite my screenshots and have correctly namespaced screenshot directories that correspond to the test run, in order to have correct tests artifacts and validations. I will know I am done when I run tests via orion-full-stack-testing, and generate different screenshots per cloudRegion.

Details

orion-full-stack-testing has the ability to run tests per cloudRegion. If someone uses Terra.validates.screenshot in a full stack context, they may potentially override their screenshots if a test combination has the equivalent browser and locale values.

For example, dev | chrome | en and staging | chrome | en test runs will generate screenshots in the same directory, en/form-factor/chrome_form-factor/spec. We should account for the cloudRegion and namespace the screenshots one more level, dev/en/form-factor/chrome_form-factor/spec This will prevent overwrites and be consistent with the test combinations that orion-full-stack-testing supports.

orion-full-stack-testing already follows our getConfigurationOptions pattern, and passes in a launcherOptions.cloudRegion to its test runner options. This property exposes the cloudRegion value (dev, staging). These options are already being passed into the visual regression service [src]

Proposed Changes

I believe the changes necessary to enable this involve small changes with the BaseCompare.js:

  1. destructure cloudRegion from options: 1
  2. set this.cloudRegion = cloudRegion || ''; 2
  3. add this.cloudRegion to the path.join call: 3

Description

Additional Context / Screenshots

@ Mentions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📦 terra-functional-testing Size: 3 Story Up Next - KC Issues that are ready to pull into an iteration for the KC team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants