Skip to content

rgunindi/Docker-Selenium-Grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n11 TalentHub 2022

Project directory structure

proje-dizin-yapisi

n11 In order to understand the test steps, let's first specify the scenario information:

Three different scenarios are tested. Our scenarios are:

  • Feature1: In the first one, the number of comments made about the selected store is checked.
  • Feature2: In the second time, the products added to the cart are tried to be purchased with the wrong credit card.
  • Feature3: In the third one, the ones with free shipping are listed according to the comment order of the searched product.

While the tests of the scenarios we have mentioned were written, they were prepared on the basis of some rules. Let's briefly talk about these rules:

  • Some of the principles that the tests prepared for a test case scenario should have:
    • Each test case tested a scenario.
    • The steps used are determined.
    • Test method names are named as a reflection of the scenario being tested.
    • Some of the tested parts were tested within the scope of integration test and some of them were tested independently from other parts.
    • Tests were automated and run.
    • Tests are written in a clear, legible and repeatable manner.
    • When the tests fail, the test run is stopped and the related error is detailed.

Parameters taken by our Test Case are as follows:

  • desired_browser: Parameter specifying which browser you want to run (Chrome-Firefox-Edge-Opera)
  • env: Parameter on which environment you want to run (test-qa-staging-prod)
  • Docker_Selenium_Grid: Parameter (true/false) about whether to run in the environment

All of the tests are known to be run in parallel. Example of standard output that we can understand running in parallel:

  • [pool-2-thread-2]
  • [pool-2-thread-3]
  • [pool-2-thread-4]

As mentioned above, different threads 2-3-4 are running in the 'pool-2' thread pool.

Selenium Grid


It is possible to run our test steps in the docker selenium grid environment. The necessary steps for this are described below:

1.Step->Giving the Parameter

First of all, by default, our tests take parameters so that they will not run (false) in the selenium environment. By changing this parameter, our tests are ready to be run in the docker selenim grid environment.

The part where the parameter is specified:

+Img-1

Proje1_Odev1.feature

The part where the parameter is specified in the Project1 feature files is shown in Img-1.

  • false: Selenium Grid Off
  • true: Selenium Grid On

desiredBrowser

Girl in a jacket

2.Step->Removing the Selenium Grid Environment

We can do this step using two (2) separate ways.

  • First Way: It is to run the shell file called dockerGridUp.sh in the Project File Environment.
    Komut satırı : (windows)    : ./dockerGridUp.sh
                   (MacOs/Linux): ./dockerGridUp.sh #chmod +x dockerGridUp.sh to allow file to run
  • Second Way: It is to stand up the seleniumGrid.yml file located in the File Environment of the project. For this:
    Komut satırı : (windows)    : docker-compose -f .\seleniumGrid.yml up
                   (MacOs/Linux): docker-compose -f .\seleniumGrid.yml up

After the Selenium Docker environment requirements are up (make sure it's Docker_Selenium_Grid->true!) the tests will be run on the selenium grid. You can run tests from an IDE (IntellijIdea-Eclipse) or from the command line with mvn verify test.

> Note: Since the number of store names from A to Z in Proje1_Odev_1 is `64524`, the test period is long.

- macOS M1 Chip OS Docker does not yet support Selenium Grid.
Selenium Grid :

2022-01-23 (3)

Reporting

To review the report generated by the cucumber-report library we have used, see the following directory:

Docker-Selenium-Grid-TestCase\target\cucumber-report

If you open the file named cucumber.html, you will see the report output similar to Img-2 below showing the test results.

+Img-2

image

When you click to look at any case test cases, you can reach the report output similar to Img-3.

+Img-3

image


NOTE

There is one thing to consider when running tests: When trying to make a large number of incorrect payment transactions from the same IP address as a guest user, the test process of the payment steps will not be completed since n11 automatically activates the Captcha system for security reasons.


Ramazan G.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published