-
Notifications
You must be signed in to change notification settings - Fork 34
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
🧪 Considerations for Integration and End-to-End Testing Strategies #1005
Comments
I will search more about Appium and share what I've found. |
|
Based on what Jiji found about Appium, I have been experimenting with integrating Appium and I want to give an update on what I've managed. Although Appium itself is well-documented, there is not much on using it for Cordova apps. The one example I did find, https://medium.com/the-web-tub/testing-cordova-apps-with-appium-2b3b236e026b (and the corresponding repo https://github.com/asialgearoid/cordova-appium-example) is very outdated and I don't think it would even work with newer versions of Cordova, Node 19, modern OS versions, etc. However, I think these tools will still be compatible if I just find out how to use the newer versions. To my understanding, the above guide leverages Appium to interface with an emulator or physical device, but it needs a different library, WebdriverIO, to interface with the underlying Webview (where all our JS runs). Because there is a lack of documentation for doing this on Cordova apps, it has taken a lot of trial and error to get this configured. Luckily I found this example project https://github.com/webdriverio/appium-boilerplate, which is more up-to-date and describes how to use WebdriverIO 7 with Appium 1.22. |
@JGreenlee @jiji14 all this is super cool, and I'm really looking forward to be able to run end-to-end testing. I have a couple of high level questions on the setup, since I haven't poked around with Appium yet:
wrt the cordova test framework, https://github.com/apache/cordova-plugin-test-framework, while it is primarily used for integration testing, it allows you to make calls to native code from test javascript. I don't see any reason why it cannot be used for integration testing, and even end-to-end testing. To answer the questions in the call today:
Here's an example of how a plugin using the plugin-test-framework runs the tests in the emulator. It uses paramedic, which basically automates the steps required for testing It seems like as long as we can launch the app in the emulator, we can write tests (either in the jasmine format, or potentially even in jest) that can just call the plugins directly instead of calling their mocks. If we wanted to go down this route, I would suggest:
Let me know what you find! |
So far I've only tried it on Android. I have observed that it uses
Yeah it installs the entire built app, plugins and all |
@jiji14 where does the Appium Server live? Does it run locally on your laptop or in the cloud? |
@shankari Here is the video for testing Appium. I launched my emulator, ran the local server, and then executed the script.
I'm not sure what "what happens if it goes away?" means exactly, but the script fails after the server stops. test-video3.mov |
If it were only running on the cloud as a commercial product (like PhoneGap build), then I would worry about what would happen if the company went out of business and the cloud service went away. But given that you are running this on your laptop, I think it is not an issue 😄 |
Oh Thanks for clarifying! Now I understand what you meant 😃 |
e-mission/e-mission-phone#1040 (comment) suggests that since Cordova plugins are able to be tested, we should be able to use them in our UI tests.
I have found documentation (https://github.com/apache/cordova-plugin-test-framework) for how to write tests for Cordova plugins (ie. unit testing the Cordova plugins themselves, independent of
e-mission-phone
), but I have not found any way to use the plugins in a test for the project (ie. integration testing of how plugins are used ine-mission-phone
.)Appium has been suggested as an E2E testing tool for Cordova projects, allowing testing of the app in a context where the Cordova plugins are defined. Appium can also be used for React Native projects, so it may be a promising long-term option.
An example Cordova project with Appium testing is here: https://github.com/asialgearoid/cordova-appium-example, but it's unclear if this actually provides the plugins or is just for testing the content inside the WebView.
The text was updated successfully, but these errors were encountered: