Skip to content

Commit

Permalink
All scenario is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
BalamiRR committed Sep 7, 2022
2 parents a15a47d + 5613c44 commit 8d3a85e
Show file tree
Hide file tree
Showing 18 changed files with 1,277 additions and 16 deletions.
65 changes: 65 additions & 0 deletions src/main/java/com/testinium/pages/ContactsP.java
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;


}

4 changes: 4 additions & 0 deletions src/main/java/com/testinium/runners/CukesRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
features = "src/main/resources/features",
glue = "com/testinium/step_definitions",
dryRun = false,
<<<<<<< HEAD
tags = "@Smoke"

=======
tags = "@Dash"
>>>>>>> feature/Contact
)
public class CukesRunner {

Expand Down
105 changes: 105 additions & 0 deletions src/main/java/com/testinium/step_definitions/Contacts.java
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();
}
}
1 change: 0 additions & 1 deletion src/main/java/com/testinium/step_definitions/Notes.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public void user_should_see_the_notes_list() {
@When("User move element from New section to Today section")
public void user_move_element_from_new_section_to_today_section() {
Actions actions = new Actions(Driver.getDriver());

actions.clickAndHold(notesP.newTable).pause(2000).moveToElement(notesP.todayTable).pause(2000).release().perform();
}

Expand Down
45 changes: 45 additions & 0 deletions src/main/resources/features/Contact.feature
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.
45 changes: 45 additions & 0 deletions target/classes/features/Contact.feature
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




4 changes: 4 additions & 0 deletions target/cucumber-reports.html

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion target/cucumber.json

Large diffs are not rendered by default.

21 changes: 9 additions & 12 deletions target/cucumber/cucumber-html-reports/overview-failures.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
<tbody>
<tr class="info">
<td>No Name (add projectName to cucumber-reporting.properties)</td>
<<<<<<< HEAD
<td>07 Sep 2022, 15:39</td>
=======
<td>07 Sep 2022, 18:28</td>
>>>>>>> feature/Contact
</tr>
</tbody>
</table>
Expand All @@ -94,22 +98,11 @@ <h2>Failures Overview</h2>
</div>


<div class="container-fluid">
<div class="row">
<div class="col-md-1 col-md-offset-10">
<i class="fa fa-chevron-circle-down fa-2x collapsable-control"
onClick="javascript:$('#report .collapsable-details').collapse('show')"></i>
<i class="fa fa-chevron-circle-up fa-2x collapsable-control"
onClick="javascript:$('#report .collapsable-details').collapse('hide')"></i>
</div>
</div>
</div>


<div class="container-fluid" id="report">
<div class="row">
<div class="col-md-10 col-md-offset-1">

<<<<<<< HEAD
<div class="elements">

<div class="element">
Expand Down Expand Up @@ -545,6 +538,10 @@ <h2>Failures Overview</h2>
onClick="javascript:$('#report .collapsable-details').collapse('show')"></i>
<i class="fa fa-chevron-circle-up fa-2x collapsable-control"
onClick="javascript:$('#report .collapsable-details').collapse('hide')"></i>
=======
<p>You have no failed scenarios in your Cucumber report</p>

>>>>>>> feature/Contact
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 8d3a85e

Please sign in to comment.