-
Notifications
You must be signed in to change notification settings - Fork 110
tests: enable automatic tests on Android. #3588
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
base: master
Are you sure you want to change the base?
Conversation
a187051
to
0201e65
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.
🙏 untested LGTM
With a few suggestions. It would be good to get a 2nd review from somebody else
`make webe2etest` | ||
|
||
Appium is used to perform automatic test on Android emulators. | ||
The test runs automatically on PRs and push to master in the Github CI. |
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.
Maybe mention make mobilee2etest
here or is it CI only?
frontends/tests/package.json
Outdated
"name": "tests", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"main": "index.js", |
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.
"main" field can be removed.
It would serve as entry file so other project could import tests from 'tests'
.
frontends/tests/e2e/base.test.js
Outdated
if (driver) await driver.deleteSession(); | ||
}); | ||
|
||
it("App main page loads", async () => { |
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.
.github/workflows/ci.yml
Outdated
PLATFORM: Android | ||
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 5 | ||
with: | ||
api-level: 34 |
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.
Why 34? Should it be a matrix with all supported API levels?
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.
Absolutely right! This was more of a "let's get a single setup working first" but it does make sense to add all levels now. I'll do it before asking for the next review
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.
It turns out that API <30 don't work out of the box and require a bit more work/investigation. I will open an issue to track this but I think it would make this PR a bit too messy and big so if it's ok for you I'd keep it for another one
frontends/tests/e2e/base.test.js
Outdated
if (driver) await driver.deleteSession(); | ||
}); | ||
|
||
it("App main page loads", async () => { |
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.
Can or should the Android tests reuse Playwright tests? The code running on both platforms is nearly identical after all. Or is the plan to write most tests in Playwright and only stuff that is different on Android here?
What is the overall plan? Maybe worth writitng it down somewhere so people who will write tests know how to proceed.
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.
Playwright and webdriver.io have different api to interact with the browser. So I don't think we can run the same tests.
https://playwright.dev/docs/writing-tests#basic-actions
https://webdriver.io/docs/api/mobile (or do we use https://github.com/admc/wd to interact with the browser?)
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.
@thisconnect is right. As far as I know there isn't really a way to reuse the tests. I will investigating whether we can at least translate one into the other easily or if we should keep it separated. I think the plan is still a bit in-flight and not set in stone yet. I'll make sure to track it in an issue.
49c1e10
to
126bca2
Compare
Before asking for reviews, here is a check list of the most common things you might need to consider: