mardi 3 avril 2018

The concept of writing automatic tests for setting up an account

I am writing tests using selenium and cucumber, I wonder about using TestNG with cucumber? When Cucumber, when TestNG? Or Both?

I have example scenario like this:

        Scenario: Successful Create Account with Valid Credentials
            Given I am on Home Page
            When I Navigate to Create Account Page
            And I fill in "User Name" with <username>
            And I fill in "Password" with <password>
            And I fill in "Password" with <password>
            And I fill in "email" with <email>
            Then I see title "Congratulation you create account"
    Examples:
        | username               | password            | email               |
        | Tom123                 | password12          | Tom@gmailcom        |
        | Kenny123               | fasfadfaadfa        | Kenny@gmailcom      |

This is simple confirm test, but if I would like to test my account creation using NastyString, and a lot of combinations?

 Scenario: Unsuccessful reate Account with invalid Credentials
            Given I am on Home Page
            When I Navigate to Create Account Page
            And I fill in "UserName" with incorrect credentials 
            Then I see error message
            And I fill in "password" with incorrect credentials
            Then I see error message
            And I fill in "email" with incorrect credentials
            Then I see error message "Try Again"

Scenario like this and tests using testNG with Data Provider with BDD style?

Aucun commentaire:

Enregistrer un commentaire