From abf44bcb457909e9395e52c50fe90d6fb001b601 Mon Sep 17 00:00:00 2001 From: User Date: Thu, 19 Oct 2023 22:36:40 +0200 Subject: [PATCH 1/3] deneme --- .../_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java index a80d14a..60c64ed 100644 --- a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java +++ b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java @@ -6,10 +6,11 @@ public class _11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps { @Given("User accesses the {string} page") public void user_accesses_the_page(String string) { + System.out.println("hello"); } - @When("the User clicks on the {string} tab") + @When(" the User clicks on the {string} tab") public void the_user_clicks_on_the_tab(String string) { From cc64cdca466c4d0dad405f925647bf9ddda8626d Mon Sep 17 00:00:00 2001 From: User Date: Thu, 19 Oct 2023 22:40:31 +0200 Subject: [PATCH 2/3] duzeltildi --- .../_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java index 60c64ed..b912e52 100644 --- a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java +++ b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java @@ -6,7 +6,7 @@ public class _11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps { @Given("User accesses the {string} page") public void user_accesses_the_page(String string) { - System.out.println("hello"); + } From a717c0fe4ba65c933c4b6b297f9235a65ceb0be3 Mon Sep 17 00:00:00 2001 From: User Date: Fri, 20 Oct 2023 22:29:34 +0200 Subject: [PATCH 3/3] pom, step definitons doldurulmaya calisiyor. --- ...erAyariAltindaIndirimleriDuzenleme.feature | 12 ++-- ...rAyariAltindaMilliyetleriDuzenleme.feature | 11 ++-- src/test/java/Pages/POM_11.java | 55 ++++++++++++++++++- src/test/java/Pages/POM_12.java | 52 +++++++++++++++++- ...AyariAltindaIndirimleriDuzenlemeSteps.java | 41 +++++++++----- ...yariAltindaMilliyetleriDuzenlemeSteps.java | 30 +++++++--- 6 files changed, 167 insertions(+), 34 deletions(-) diff --git a/src/test/java/FeatureFiles/_11_ParametrelerAyariAltindaIndirimleriDuzenleme.feature b/src/test/java/FeatureFiles/_11_ParametrelerAyariAltindaIndirimleriDuzenleme.feature index e1ef4f0..fed5e9c 100644 --- a/src/test/java/FeatureFiles/_11_ParametrelerAyariAltindaIndirimleriDuzenleme.feature +++ b/src/test/java/FeatureFiles/_11_ParametrelerAyariAltindaIndirimleriDuzenleme.feature @@ -8,21 +8,21 @@ Feature: Scenario: Adding Discounts - Given User accesses the "Setup > Parameters" page - When the User clicks on the "Discounts" tab + Given User click on the Setup und Parameters tabs + When the User clicks on the Discounts tab And the User fills in the necessary information to add a new discount Then the discount should be added Scenario: Editing Discounts - Given User accesses the "Setup > Parameters" page - When the User clicks on the "Discounts" tab + Given User click on the Setup und Parameters tabs + When the User clicks on the Discounts tab And the User updates the necessary information for an existing discount Then the changes should be saved Scenario: Deleting Discounts - Given User accesses the "Setup > Parameters" page - When the User clicks on the "Discounts" tab + Given User click on the Setup und Parameters tabs + When the User clicks on the Discounts tab And the User initiates the process to delete an existing discount Then the discount should be deleted, and the User completes the verification step diff --git a/src/test/java/FeatureFiles/_12_ParametrelerAyariAltindaMilliyetleriDuzenleme.feature b/src/test/java/FeatureFiles/_12_ParametrelerAyariAltindaMilliyetleriDuzenleme.feature index 122ee4b..0adae9a 100644 --- a/src/test/java/FeatureFiles/_12_ParametrelerAyariAltindaMilliyetleriDuzenleme.feature +++ b/src/test/java/FeatureFiles/_12_ParametrelerAyariAltindaMilliyetleriDuzenleme.feature @@ -6,22 +6,23 @@ Feature:Parameters Nationalities When Enter username and password and click login button Then User should login successfully - Scenario: - Adding Nationalities + Scenario: Adding Nationalities - Given User accesses the "Setup > Parameters" page. + Given User click on the Setup und Parameters tabs When the User is on the page to add nationalities. And the User enters the required information to add a new nationality. Then the nationality should be added. + Scenario: Editing Nationalities - Given User accesses the "Setup > Parameters" page. + Given User click on the Setup und Parameters tabs When the User is on the page to edit nationalities And the User updates the valid information for an existing nationality Then the changes should be saved + Scenario: Deleting Nationalities - Given User accesses the "Setup > Parameters" page. + Given User click on the Setup und Parameters tabs When the User is on the page to delete nationalities And the User initiates the process to delete an existing nationality Then the nationality should be deleted, and the User completes the verification step diff --git a/src/test/java/Pages/POM_11.java b/src/test/java/Pages/POM_11.java index 43236e3..69a85ba 100644 --- a/src/test/java/Pages/POM_11.java +++ b/src/test/java/Pages/POM_11.java @@ -1,4 +1,57 @@ package Pages; -public class POM_11 { +import Utilities.Events; +import Utilities.WBA; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.PageFactory; + +import java.awt.*; + +public class POM_11 extends Events { + + public POM_11() { + PageFactory.initElements(WBA.getDriver(), this); + } + + @FindBy(css = "span[class='mat-mdc-tooltip-trigger logo-text']") + public WebElement textTechnoStudy; + @FindBy(xpath = "//ms-add-button[contains(@tooltip,'ADD')]//button") + public WebElement addButton; + @FindBy(xpath = "//ms-text-field[@formcontrolname='name']/input") + public WebElement nameInput; + @FindBy(xpath = "//ms-save-button/button") + public WebElement saveButton; + @FindBy(xpath = "//div[contains(text(),'successfully')]") + public WebElement successMessage; + @FindBy(xpath = "//mat-form-field//input[@data-placeholder='Name']") + public WebElement searchInput; + @FindBy(xpath = "//ms-search-button//button") + public WebElement searchButton; + @FindBy(xpath = "(//ms-delete-button//button)[1]") + public WebElement deleteImageButton; + @FindBy(xpath = "//button[@type='submit']") + public WebElement deleteDialogButton; + @FindBy(xpath = "(//ms-edit-button)[1]") + public WebElement editButton; + @FindBy(xpath = "(//span[text()='Setup'])[1]") + public WebElement setup; + @FindBy(xpath = "//span[text()='Human Resources']") + public WebElement humanResources; + @FindBy(xpath = "(//span[text()='Setup'])[3]") + public WebElement setupHumanResources; + @FindBy(xpath = "//span[text()='Position Categories']") + public WebElement positionCategories; + + public WebElement userClickOnTheSetupUndParametersTabs() { + } + + public WebElement theUserClicksOnTheDiscountsTab() { + } + + public WebElement theChangesShouldBeSaved() { + } + + public WebElement theUserInitiatesTheProcessToDeleteAnExistingDiscount() { + } } diff --git a/src/test/java/Pages/POM_12.java b/src/test/java/Pages/POM_12.java index 38d5e83..c067a37 100644 --- a/src/test/java/Pages/POM_12.java +++ b/src/test/java/Pages/POM_12.java @@ -1,4 +1,54 @@ package Pages; -public class POM_12 { +import Utilities.Events; +import Utilities.WBA; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.PageFactory; + +public class POM_12 extends Events { + + public POM_12() { + PageFactory.initElements(WBA.getDriver(), this); + } + + + @FindBy(css = "span[class='mat-mdc-tooltip-trigger logo-text']") + public WebElement textTechnoStudy; + @FindBy(xpath = "//ms-add-button[contains(@tooltip,'ADD')]//button") + public WebElement addButton; + @FindBy(xpath = "//ms-text-field[@formcontrolname='name']/input") + public WebElement nameInput; + @FindBy(xpath = "//ms-save-button/button") + public WebElement saveButton; + @FindBy(xpath = "//div[contains(text(),'successfully')]") + public WebElement successMessage; + @FindBy(xpath = "//mat-form-field//input[@data-placeholder='Name']") + public WebElement searchInput; + @FindBy(xpath = "//ms-search-button//button") + public WebElement searchButton; + @FindBy(xpath = "(//ms-delete-button//button)[1]") + public WebElement deleteImageButton; + @FindBy(xpath = "//button[@type='submit']") + public WebElement deleteDialogButton; + @FindBy(xpath = "(//ms-edit-button)[1]") + public WebElement editButton; + @FindBy(xpath = "(//span[text()='Setup'])[1]") + public WebElement setup; + @FindBy(xpath = "//span[text()='Human Resources']") + public WebElement humanResources; + @FindBy(xpath = "(//span[text()='Setup'])[3]") + public WebElement setupHumanResources; + @FindBy(xpath = "//span[text()='Position Categories']") + public WebElement positionCategories; + + public WebElement theUserIsOnThePageToAddNationalities() { + } + + public WebElement theUserIsOnThePageToEditNationalities() { + } + + public WebElement theUserInitiatesTheProcessToDeleteAnExistingNationalit() { + } + } diff --git a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java index b912e52..c8b18c2 100644 --- a/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java +++ b/src/test/java/StepDefinitons/_11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps.java @@ -1,44 +1,59 @@ package StepDefinitons; +import Pages.POM_00; +import Pages.POM_11; import io.cucumber.java.en.*; public class _11_ParametrelerAyariAltindaIndirimleriDuzenlemeSteps { - @Given("User accesses the {string} page") - public void user_accesses_the_page(String string) { - - - + POM_11 lc=new POM_11(); + @Given("User click on the Setup und Parameters tabs") + public void userClickOnTheSetupUndParametersTabs() { + lc.myClick(lc.userClickOnTheSetupUndParametersTabs()); } - @When(" the User clicks on the {string} tab") - public void the_user_clicks_on_the_tab(String string) { + @When("the User clicks on the Discounts tab") + public void theUserClicksOnTheDiscountsTab() { + lc.myClick(lc.theUserClicksOnTheDiscountsTab()); } - @When("the User fills in the necessary information to add a new discount") - public void the_user_fills_in_the_necessary_information_to_add_a_new_discount() { - + @And("the User fills in the necessary information to add a new discount") + public void theUserFillsInTheNecessaryInformationToAddANewDiscount() { + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); } - @Then("the discount should be added") - public void the_discount_should_be_added() { + @Then("the discount should be added") + public void theDiscountShouldBeAdded() { + lc.mySendKeys(lc."early registration discount %25"); } @And("the User updates the necessary information for an existing discount") public void theUserUpdatesTheNecessaryInformationForAnExistingDiscount() { + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); } @Then("the changes should be saved") public void theChangesShouldBeSaved() { + lc.myClick(lc.theChangesShouldBeSaved()); + } @And("the User initiates the process to delete an existing discount") public void theUserInitiatesTheProcessToDeleteAnExistingDiscount() { + lc.myClick(lc.theUserInitiatesTheProcessToDeleteAnExistingDiscount()); } @Then("the discount should be deleted, and the User completes the verification step") public void theDiscountShouldBeDeletedAndTheUserCompletesTheVerificationStep() { + lc.verifyContainsText(lc.successMessage, "success"); + } } -} +} \ No newline at end of file diff --git a/src/test/java/StepDefinitons/_12_ParametrelerAyariAltindaMilliyetleriDuzenlemeSteps.java b/src/test/java/StepDefinitons/_12_ParametrelerAyariAltindaMilliyetleriDuzenlemeSteps.java index bd6a2d0..c0c82fe 100644 --- a/src/test/java/StepDefinitons/_12_ParametrelerAyariAltindaMilliyetleriDuzenlemeSteps.java +++ b/src/test/java/StepDefinitons/_12_ParametrelerAyariAltindaMilliyetleriDuzenlemeSteps.java @@ -1,44 +1,58 @@ package StepDefinitons; +import Pages.POM_11; +import Pages.POM_12; import io.cucumber.java.en.*; public class _12_ParametrelerAyariAltindaMilliyetleriDuzenlemeSteps { + POM_12 lc=new POM_12(); - @Given("User accesses the {string} page.") - public void user_accesses_the_page(String string) { - } @When("the User is on the page to add nationalities.") - public void the_user_is_on_the_page_to_add_nationalities() { - + public void theUserIsOnThePageToAddNationalities() { + lc.myClick(lc.theUserIsOnThePageToAddNationalities()); } - @When("the User enters the required information to add a new nationality.") - public void the_user_enters_the_required_information_to_add_a_new_nationality() { + + @And("the User enters the required information to add a new nationality.") + public void theUserEntersTheRequiredInformationToAddANewNationality() { + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); } + + @Then("the nationality should be added.") public void the_nationality_should_be_added() { - + lc.myClick(lc.); } @When("the User is on the page to edit nationalities") public void theUserIsOnThePageToEditNationalities() { + lc.myClick(lc.theUserIsOnThePageToEditNationalities()); } @And("the User updates the valid information for an existing nationality") public void theUserUpdatesTheValidInformationForAnExistingNationality() { + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + lc.mySendKeys(lc.""); + } @When("the User is on the page to delete nationalities") public void theUserIsOnThePageToDeleteNationalities() { + lc.myClick(lc.); } @And("the User initiates the process to delete an existing nationality") public void theUserInitiatesTheProcessToDeleteAnExistingNationality() { + lc.myClick(lc.theUserInitiatesTheProcessToDeleteAnExistingNationalit()); } @Then("the nationality should be deleted, and the User completes the verification step") public void theNationalityShouldBeDeletedAndTheUserCompletesTheVerificationStep() { + lc.verifyContainsText(lc.successMessage,"success"); } }