-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WALLET-412: Run UI-based tests in CI #20
Conversation
730b426
to
86cda4e
Compare
This is ready for review, as it adds a couple of changes that are desirable:
However, the main point of this work was to enable UI tests in CI, or at least in Docker, and that didn't work out. |
.detoxrc.js
Outdated
artifacts: { | ||
rootDir: process.env.NODE_ENV === "docker" ? "/screenshots/" : "./screenshots/", | ||
plugins: { | ||
log: {"enabled": true}, | ||
uiHierarchy: {"enabled": true}, | ||
screenshot: { | ||
keepOnlyFailedTestsArtifacts: false, | ||
takeWhen: { | ||
"testStart": true, | ||
"testDone": true | ||
} | ||
}, | ||
video: { | ||
enabled: true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds more output to the UI-based tests, which is useful for debug purpose even outside of CI.
Dockerfile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Dockerfile is a basis, but it currently does not run the UI-based tests successfully. Arguably, this could be removed from the repo altogether, but some of the work that went in running the emulator in the container is good to keep around I would say.
android-config/signing-config.gradle
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change aligns the naming convention with the gradle typical system properties.
await this.signInFormUsernameInput.runScript(`(element) => { | ||
element.value = "${username}"; | ||
}`); | ||
await this.signInFormUsernameInput.replaceText(username); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a more readable approach, using a more appropriate API for the task.
}); | ||
|
||
await expect(this.signInSubmitButton).toExist(); | ||
await this.signInSubmitButton.tap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto using a more expressive API for the given task.
by.web.xpath('//button[text()="Continue"]') | ||
by.web.cssSelector('button[data-testid="prompt-continue"]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using data-testid
attributes, meant for automated tests and more stable than text content, is a good practice.
plugins/withSigningConfig.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change moves the signing configuration out of the global gradle config into the environment, which is easier to integrate in CI/CD and is a more appropriate scope.
run_docker_ui_tests.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the Dockerfile, useful findings but currently not working as desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some conditionals based on running docker in CI and there are still instructions for docker in the readme. Do these need cleaning up now we are not including the dockerfile?
This is an initial test to see if hardware acceleration works in CI
Previously, the keystore configuration was stored in the global gradle configuration, which is fine for dev machines, but more problematic for CI. Keystore configuration now comes from environment variables, which is easier to manipulate in CI.
HW acceleration is available in the CI runner.
This doesn't work, so we aren't pursuing this approach for the time being.
132293d
to
e235929
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This adds the setup required to run the Detox UI-based tests in CI: