Automated tests for demo site Luma – Magento eCommerce
- 🛠️ Stack of technologies
- 📄 Description
- 📋 List of UI tests
- 🔌 Running tests from the terminal
- 🔧 Property files
- ⚙️ Running tests in Jenkins
- 📊 Test results report in Allure Report
- 🚀 Integration with Allure TestOps
- 🔗 Integration with Jira
- 📣 Integration with Telegram
- 📹 Video of running tests
The test project consists of UI tests and includes the following interesting features:
- ✔️ Page Object pattern: Utilizes the
Page Object
pattern for better test organization and maintenance. - ✔️ Test data generation: Test data is generated using the
Faker
library, providing realistic and randomized test inputs. - ✔️ Parameterized tests: Employs parameterized tests to efficiently test multiple scenarios with different input values.
- ✔️ Parameterized build: Supports
parameterized builds
for easily configuring and customizing test runs. - ✔️ Configuration files: Provides
local, remote, and authentication configuration files
with properties for seamless test execution in different environments. - ✔️ Owner library: Uses the
Owner
library to handle application configuration through Java properties files, ensuring flexibility and ease of configuration management. - ✔️ Allure TestOps integration: Integrates with
Allure TestOps
for comprehensive test reporting and analytics. - ✔️ Autotests as test documentation: The automated tests serve as living documentation, providing up-to
- Add product item to cart with selected size and color
- Add product item to cart without selected options
- Check advanced search separately by SKU and Product Name
- Check advanced search by 2 fields at the same time: 'Product Name' and 'SKU'
- Successful creation of new customer
- Check that fields
firstname
,lastname
,email_address
,password
are required when creating an account
- Check password validation error messages
To run tests from the terminal using Gradle, you can use the following commands:
gradle clean test -Denv='local'
When using the local
environment, the tests will be executed locally on your machine.
gradle clean test -Denv='remote'
When using the remote
environment, the tests will be executed remotely using Selenide.
By using the -D
flag followed by the property name (env
in this case) and its corresponding value (local
or remote
), you can pass system properties to your tests during the Gradle execution. The tests can then access these
properties to determine the execution behavior based on the specified environment.
Possible properties in ${env}.properties
file:
browserWithVersion=
baseUrl=
browserSize=
remoteDriverUrl=
- remoteDriverUrl - URL for remote WebDriver (Selenoid)
- baseUrl - base URL for UI tests
- browserWithVersion - browser and its version
- browserSize - size of browser
Possible properties in auth.properties
file:
usernameSelenoid=
passwordSelenoid=
It is needed to adapt auth.properties files locally based on your credentials to remote Selenoid.
Running tests in Jenkins
To execute the tests in Jenkins, use the following command:
gradle clean test "-DbrowserWithVersion=${BROWSER_WITH_VERSION}" -DbaseUrl=${BASE_URL} -DbrowserSize=${BROWSER_SIZE} -DremoteDriverUrl=${SELENOID_URL}
This command includes various system properties that are used to configure the test execution in Jenkins:
-DbrowserWithVersion=${BROWSER_WITH_VERSION}
: Specifies the browser and its version to be used for the test execution.-DbaseUrl=${BASE_URL}
: Sets the base URL for the application under test.-DbrowserSize=${BROWSER_SIZE}
: Defines the browser window size.-DremoteDriverUrl=${SELENOID_URL}
: Specifies the URL of the remote WebDriver, such as Selenium Grid or Selenoid.
Make sure to replace ${BROWSER_WITH_VERSION}
, ${BASE_URL}
, ${BROWSER_SIZE}
, and ${SELENOID_URL}
with the
appropriate values based on your Jenkins configuration and test requirements.
Main page of the build:
Job configuration:
Test results report in Allure Report
From Jenkins
it is possible to switch to reports generated by
Allure
.
Integration with Allure TestOps
Integration with Jira
After passing all the tests, an automatic report is sent to the Telegram
messenger.
A video is attached to each test in the Allure report.
Moreover, in each test run of the Allure report you can see Browser console logs
and Page
source
.