-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,277 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.testinium.pages; | ||
|
||
import com.testinium.utilities.Driver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.openqa.selenium.support.PageFactory; | ||
|
||
public class ContactsP { | ||
|
||
public ContactsP(){ | ||
PageFactory.initElements(Driver.getDriver(), this); | ||
} | ||
|
||
@FindBy(partialLinkText = "Contacts") | ||
public WebElement contactModule; | ||
|
||
@FindBy(xpath = "//button[@accesskey='c']") | ||
public WebElement createContact; | ||
|
||
@FindBy(xpath = "//button[@accesskey='l']") | ||
public WebElement callList; | ||
|
||
@FindBy(name = "name") | ||
public WebElement nameInput; | ||
|
||
@FindBy(name = "street") | ||
public WebElement streetInput; | ||
|
||
@FindBy(name = "phone") | ||
public WebElement phoneNoInput; | ||
|
||
@FindBy(name = "email") | ||
public WebElement emailInput; | ||
|
||
@FindBy(xpath="//span[.='Ok']") | ||
public WebElement okBtn; | ||
|
||
@FindBy(xpath = "(//div[@class='o_checkbox']/input)[12]") | ||
public WebElement newContact; | ||
|
||
@FindBy(xpath = "(//div[@class='o_cp_sidebar']/div/div)[2]") | ||
public WebElement actionInput; | ||
|
||
@FindBy(xpath = "//a[@data-index='3']") | ||
public WebElement deleteInput; | ||
|
||
@FindBy(xpath = "(//div[@class='o_kanban_view o_res_partner_kanban o_kanban_ungrouped']/div)[1]") | ||
public WebElement firstUser; | ||
|
||
@FindBy(xpath = "//div[@class='oe_title']") | ||
public WebElement editTitle; | ||
|
||
@FindBy(xpath = "//button[@class='btn btn-primary btn-sm o_form_button_edit']") | ||
public WebElement editBtn; | ||
|
||
@FindBy(xpath = "//div[@class='btn-group o_dropdown open']") | ||
public WebElement printInput; | ||
|
||
|
||
@FindBy(xpath = "(//div[@class='btn-group o_dropdown open']/button)") | ||
public WebElement duePayment; | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
src/main/java/com/testinium/step_definitions/Contacts.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package com.testinium.step_definitions; | ||
|
||
import com.testinium.pages.ContactsP; | ||
import com.testinium.utilities.Driver; | ||
import io.cucumber.java.en.Then; | ||
import io.cucumber.java.en.When; | ||
import org.junit.Assert; | ||
import org.openqa.selenium.support.ui.ExpectedConditions; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
||
public class Contacts { | ||
|
||
ContactsP contactP = new ContactsP(); | ||
|
||
WebDriverWait wait = new WebDriverWait(Driver.getDriver(), 20); | ||
|
||
@When("User is at Contact dashboard") | ||
public void user_is_at_contact_dashboard() throws InterruptedException { | ||
Thread.sleep(3000); | ||
contactP.contactModule.click(); | ||
} | ||
|
||
@When("User clicks the create button") | ||
public void user_clicks_the_create_button() throws InterruptedException { | ||
Thread.sleep(3000); | ||
contactP.createContact.click(); | ||
} | ||
|
||
@When("User enters name {string}") | ||
public void user_enters_name(String string) { | ||
wait.until(ExpectedConditions.visibilityOf(contactP.nameInput)); | ||
contactP.nameInput.clear(); | ||
contactP.nameInput.sendKeys(string); | ||
} | ||
|
||
@When("User enters {string}") | ||
public void user_enters(String streetName) { | ||
contactP.streetInput.sendKeys(streetName); | ||
} | ||
|
||
@When("User enters {string} and {string}") | ||
public void user_enters_and(String phoneNo, String eMail) { | ||
contactP.phoneNoInput.sendKeys(phoneNo); | ||
contactP.emailInput.sendKeys(eMail); | ||
} | ||
|
||
@Then("User sees the created new contact details at dashboard") | ||
public void user_sees_the_created_new_contact_details_at_dashboard() { | ||
contactP.contactModule.click(); | ||
wait.until(ExpectedConditions.visibilityOf(contactP.contactModule)); | ||
contactP.okBtn.click(); | ||
} | ||
|
||
@When("User clicks list section and choose the profile") | ||
public void user_clicks_list_section_and_choose_the_profile() throws InterruptedException { | ||
contactP.callList.click(); | ||
Thread.sleep(3000); | ||
contactP.newContact.click(); | ||
} | ||
|
||
@When("User clicks Action to choose delete button") | ||
public void user_clicks_action_to_choose_delete_button() throws InterruptedException { | ||
contactP.actionInput.click(); | ||
Thread.sleep(3000); | ||
contactP.deleteInput.click(); | ||
} | ||
@When("User clicks for editing button") | ||
public void user_clicks_for_editing_button() { | ||
contactP.editBtn.click(); | ||
} | ||
|
||
@Then("User sees deleted profile") | ||
public void user_sees_deleted_profile() { | ||
String actualMsg = contactP.deleteInput.getText(); | ||
String expectedMsg = "Deleted"; | ||
Assert.assertEquals(actualMsg, expectedMsg); | ||
} | ||
|
||
@When("User selects the profile") | ||
public void user_selects_the_profile() { | ||
contactP.firstUser.click(); | ||
wait.until(ExpectedConditions.visibilityOf(contactP.editTitle)); | ||
} | ||
|
||
@Then("User sees the updated contact details at dashboard") | ||
public void user_sees_the_updated_contact_details_at_dashboard() { | ||
contactP.contactModule.click(); | ||
} | ||
|
||
// @When("User clicks and goes directly to the profile") | ||
// public void user_clicks_and_goes_directly_to_the_profile() { | ||
// | ||
// } | ||
|
||
@When("User clicks the print button and then select due payments") | ||
public void user_clicks_the_print_button_and_then_select_due_payments() throws InterruptedException { | ||
contactP.printInput.click(); | ||
Thread.sleep(3000); | ||
} | ||
|
||
@Then("User can see the downloaded file") | ||
public void user_can_see_the_downloaded_file() { | ||
contactP.duePayment.click(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Feature: Testinium app Inventory feature | ||
|
||
User Story: | ||
Background: As a Posmanager, should be able to create, delete, edit a contact and change the colour of the new contact | ||
Given User login to test other features | ||
Given User is at Contact dashboard | ||
|
||
Scenario Outline: Verify that the user can create a new contact | ||
When User clicks the create button | ||
And User enters name "<name>" | ||
And User enters "<street name>" | ||
And User enters "<phone number>" and "<email>" | ||
And User clicks save button | ||
Then User sees the created new contact details at dashboard | ||
Examples: | ||
| name | street name | phone number | email | | ||
| &Dustin| Haussman | +99999999999 | abcd@info.com| | ||
|
||
Scenario: Verify that the user can delete a contact from 2 different side | ||
When User clicks list section and choose the profile | ||
And User clicks Action to choose delete button | ||
# And User clicks and goes directly to the profile | ||
# And User clicks Action to choose delete button | ||
Then User sees deleted profile | ||
|
||
Scenario Outline: Verify that the user can edit the contact | ||
When User selects the profile | ||
And User clicks for editing button | ||
And User enters name "<name>" | ||
And User enters "<street name>" | ||
And User enters "<phone number>" and "<email>" | ||
And User clicks save button | ||
Then User sees the updated contact details at dashboard | ||
Examples: | ||
| name | street name | phone number | email | | ||
| &Dustin| Haussman | +99999999999 | abcd@info.com| | ||
|
||
Scenario: Verify that the user can print for his due payments | ||
When User selects the profile | ||
And User clicks the print button and then select due payments | ||
Then User can see the downloaded file | ||
|
||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Feature: Testinium app Inventory feature | ||
|
||
User Story: | ||
Background: As a Posmanager, should be able to create, delete, edit a contact and change the colour of the new contact | ||
Given User login to test other features | ||
Given User is at Contact dashboard | ||
|
||
Scenario Outline: Verify that the user can create a new contact | ||
When User clicks the create button | ||
And User enters name "<name>" | ||
And User enters "<street name>" | ||
And User enters "<phone number>" and "<email>" | ||
And User clicks save button | ||
Then User sees the created new contact details at dashboard | ||
Examples: | ||
| name | street name | phone number | email | | ||
| &Dustin| Haussman | +99999999999 | abcd@info.com| | ||
|
||
Scenario: Verify that the user can delete a contact from 2 different side | ||
When User clicks list section and choose the profile | ||
And User clicks Action to choose delete button | ||
# And User clicks and goes directly to the profile | ||
# And User clicks Action to choose delete button | ||
Then User sees deleted profile | ||
|
||
Scenario Outline: Verify that the user can edit the contact | ||
When User selects the profile | ||
And User clicks for editing button | ||
And User enters name "<name>" | ||
And User enters "<street name>" | ||
And User enters "<phone number>" and "<email>" | ||
And User clicks save button | ||
Then User sees the updated contact details at dashboard | ||
Examples: | ||
| name | street name | phone number | email | | ||
| &Dustin| Haussman | +99999999999 | abcd@info.com| | ||
|
||
Scenario: Verify that the user can print for his due payments | ||
When User selects the profile | ||
And User clicks the print button and then select due payments | ||
Then User can see the downloaded file | ||
|
||
|
||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.