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.
- 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.
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
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
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.
- http://localhost:4444/ui/index.html The status of the browsers can be followed via
> 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 :
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
When you click to look at any case test cases, you can reach the report output similar to Img-3.
+Img-3
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.