Scenarios contained in feature files written in Gherkin language. Available scenarios can be found here.
Defined for the ownCloud Android app
-
Scenarios are defined with Gherkin Syntax.
-
Steps are interpreted by Cucumber.
-
Step implementation language: Java
-
Device interaction with Appium
-
Reports generated with Cucumber Reports
- With git:
git clone https://github.com/owncloud/android-scenario-testing.git
- Download a zip file
Different requirements:
-
Appium
instance running and reachable. Check this link to get futher info about Appium. -
At least, one device/emulator attached and reachable via adb. Check command
adb devices
to ensureAppium
will get the device reference to interact with it. -
The environment variable
$ANDROID_HOME
needs to be correctly set up, pointing to the Android SDK folder
First, build the app from the expected branch/commit to get the test object.
Since the app does not have a test variant yet, you'll find the way to build it in the buildapk folder of the current repository.
The buildAPK script:
- will disable welcome wizard
- will disable the release notes
- will set basic auth as forced authentication method, required to execute the test suites
- will build a release-signed apk with the given keystore path and pass (check script variables)
- will move the final artifact to the correct place (
/src/test/resources
folder in the current structure)
As commented, check the script's variables for the proper setup in your own environment or CI system.
In the current repository there will be always an owncloud.apk
file located in /src/test/resources
, as example or fallback.
The script executeTests
will launch the tests. The following environment variables must be set in advance
$OC_SERVER_URL (mandatory): URL of ownCloud server to test against
$APPIUM_URL (optional): Appium server URL.
If Appium Server is not specified, will be used "localhost:4723"
$UDID_DEVICE (optional): ID of the device/simulator to execute the tests onto.
This ID could be get by executing `adb devices`
The script needs some parameters. Check help executeTests -h
To execute all tests but the ignored ones (or any other tagged ones):
export UDID_DEVICE=emulator-5554
export OC_SERVER_URL=https://my.owncloud.server
export APPIUM_URL=localhost:4723
./executeTests -t "not @ignore"
The execution will display step by step how the scenario is being executed.
** the not @ignore
option is set by default
More info in Cucumber reference
NOTE: Since there are two kinds of backends available (oC10, oCIS), not all tests are suitable to be executed over both. Those tests have been tagged with:
nooc10
: tests to be executed only over oCIS, not suitable for oC10.noocis
: tests to be executed only over oC10, not suitable for oCIS.
It's important to execute the tests with the mentioned tags to avoid wrong positives. Example commands:
./executeTests -t "not @ignore and not @noocis"
This command will execute tests that are not ignored and suitable for oCIS. If this command is run over an oC10 instance, some tests will fail.
./executeTests -t "not @ignore and not @nooc10"
This command will execute tests that are not ignored and suitable for oC10. If this command is run over an oCIS instance, some tests will fail.
Every feature file, and every rule inside every feature file is also tagged, for isolated execution just in case.
In the folder target
, you will find a report with the execution results in html and json formats.
Besides of that, by setting the cucumber.properties
file, a nicer final report is integrated with Cucumber reports. An account in such platform (integrated with GitHub) is enough to use it. A new env variable must be set in advance in order to send reports to the platform. Token is provided in the Cucumber Reports account for every collection:
export CUCUMBER_PUBLISH_TOKEN=d97...
Also, add in cucumber.properties
file the following key-values (disabled by default):
cucumber.publish.quiet=false
cucumber.publish.enabled=true
Up to date: 02/Aug/2024
Cucumber version | 7.18.0 |
Appium version | 2.11.2 |
Appium uiautomator2 driver version | 3.7.7 |
Java client version | 9.2.2 |
Note: This repository was forked from Cucumber-java skeleton repository, which contains the base skeleton to start working.