Skip to content

shinkai-tester/luma-ui-tests-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated tests for demo site Luma – Magento eCommerce

Logo of Luma

Content

🛠️ Stack of technologies

IntelliJ IDEA Logo GitHub Logo Java Logo JUnit5 Logo Gradle Logo Selenide Logo Jenkins Logo Selenoid Logo Allure Report Logo Allure TestOps Logo Jira Logo Telegram Logo

📄 Description

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

📋 List of UI Tests

Cart Operations

  • Add product item to cart with selected size and color
  • Add product item to cart without selected options

Advanced Search

  • Check advanced search separately by SKU and Product Name
  • Check advanced search by 2 fields at the same time: 'Product Name' and 'SKU'

Customer Management

  • Successful creation of new customer
  • Check that fields firstname, lastname, email_address, password are required when creating an account

Password Validation

  • Check password validation error messages

🔌 Running tests from the terminal

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.

🔧 Property files

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:

Jenkins

Job configuration:

Jenkins Video demonstrating configuring a job

Test results report in Allure Report

From Jenkins it is possible to switch to reports generated by Allure.

allure5
allure5

Integration with Allure TestOps

allure5
allure5

Integration with Jira

jira-project

Telegram notifications using a bot

After passing all the tests, an automatic report is sent to the Telegram messenger.

Screenshot of Telegram Notifications

Test running example in Selenoid

A video is attached to each test in the Allure report.

Selenoid Video demonstrating its usage

Moreover, in each test run of the Allure report you can see Browser console logs and Page source.

Back to content

About

Automated tests for demo site Luma – Magento eCommerce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages