Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: LCW Web-site Test-1

Scenario: Enter the Web-Page in order to check the functions out whether work properly.

Given Open website go to home page


25 changes: 25 additions & 0 deletions src/test/java/FeaturesFiles/LCW-TEST-112-LiveChatTest.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Feature: Datatable Functionality

Background:
Given Open website go to home page

Scenario:
And Click on the element in the dialog
| clickincokie1 |
| clickninanladım |
| livesupportclick |
| clickinorders |
| quitlick |
| quitclickYes |


# clickincokie1,clickninanladım,livesupportclick,clickinorders,sendMessageWithClick

# And User sending the keys in dialog content
#
#
# And Click on the element in the dialog
#
#
#
# And Success message should be displayed
43 changes: 42 additions & 1 deletion src/test/java/Pages/DialogContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,33 @@ public DialogContent() {
@FindBy(css = "[class='menu-header-item__title--waikiki']")
private WebElement assertPage;

//orcun112---------------------------------
@FindBy(xpath = "(//*[@class='editable ins-element-editable editable-text'])[3]")
private WebElement clickincokie1;
@FindBy(xpath = "//button[text()='ANLADIM']")
private WebElement clickninanladım;
@FindBy(xpath = "//*[@id='_sorun_icon_img']")
private WebElement livesupportclick;

@FindBy(xpath = "//div[text()='Sipariş Durumum']")
private WebElement clickinorders;

@FindBy(xpath = "//*[@id='endButton']")
private WebElement quitlick;
//
@FindBy(xpath = "//span[text()='Evet']")
private WebElement quitclickYes;


//-----------------------------------------

WebElement myElement;

public void findAndSend(String strElement, String value) {

switch (strElement) {


// case "searchInput":
// myElement = searchInput;
// break;
Expand All @@ -37,6 +58,24 @@ public void findAndSend(String strElement, String value) {
public void findAndClick(String strElement) {

switch (strElement) {
case "clickincokie1":
myElement = clickincokie1;
break;
case "clickninanladım":
myElement = clickninanladım;
break;
case "livesupportclick":
myElement = livesupportclick;
break;
case "clickinorders":myElement=clickinorders;break;

case "quitlick":
myElement = quitlick;
break;
case "quitclickYes":
myElement = quitclickYes;
break;


// case "addToCart":
// myElement = addToCart;
Expand All @@ -53,7 +92,9 @@ public void findAndContainsText(String strElement, String text) { // 2.aşama
// burda string isimden weblemente ulaşıcam
switch (strElement) {

case "assertPage": myElement = assertPage; break;
case "assertPage":
myElement = assertPage;
break;

}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/Pages/Parent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Parent {

public void sendKeysFunction(WebElement element, String value) {//3.Aşama


waitUntilClickable(element);
waitUntilVisible(element);
scrollToElement(element);
element.clear();
Expand Down Expand Up @@ -48,9 +48,9 @@ public void verifyContainsText(WebElement element, String text)
waitUntilVisible(element);
Assert.assertTrue(element.getText().toLowerCase().contains(text.toLowerCase()));
}
public List<WebElement> waitVisibleListAllElement(List<WebElement> elementList) {
public List<String> visibilityOfAllElement(List<String> elementList) {
WebDriverWait wait = new WebDriverWait(GWD.getDriver(), Duration.ofSeconds(30));
wait.until(ExpectedConditions.visibilityOfAllElements(elementList));
wait.until(ExpectedConditions.visibilityOfAllElements((WebElement) elementList));
return elementList;
}

Expand Down
Binary file modified src/test/java/Resources/LCWtestCases.xlsx
Binary file not shown.
3 changes: 3 additions & 0 deletions src/test/java/StepDefinitions/LWCmensbottesting.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public void open_website_go_to_home_page() {
WebDriver driver = GWD.getDriver();
driver.get("https://www.lcwaikiki.com/tr-TR/TR");
driver.manage().window().maximize();
// driver.manage().deleteAllCookies();
// driver.switchTo().alert().dismiss();

}
@When("Verify that you are on the home page")
public void verify_that_you_are_on_the_home_page() {
Expand Down
60 changes: 60 additions & 0 deletions src/test/java/StepDefinitions/_01_CheckTheLiveChat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package StepDefinitions;

import Pages.DialogContent;
import Utilities.GWD;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.en.And;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;

import java.util.List;

public class _01_CheckTheLiveChat {

DialogContent dc = new DialogContent();
WebDriver driver = GWD.getDriver();




@And("Click on the element in the dialog")
public void clickOnTheElementInTheDialog(DataTable elements) throws InterruptedException {
Thread.sleep(8000);
dc.findAndClick("clickincokie1");
dc.findAndClick("clickninanladım");
dc.findAndClick("livesupportclick");

//compulsory usage threadsleep unfortunately :((((
Thread.sleep(8000);
driver.switchTo().frame(7);
dc.findAndClick("clickinorders");
Thread.sleep(8000);
dc.findAndClick("quitlick");
Thread.sleep(8000);
dc.findAndClick("quitclickYes");





}



@And("User sending the keys in dialog content")
public void userSendingTheKeysInDialogContent(DataTable elements) throws InterruptedException {



}


@And("Success message should be displayed")
public void successMessageShouldBeDisplayed() {




}
}
Binary file modified target/test-classes/Pages/DialogContent.class
Binary file not shown.
Binary file modified target/test-classes/Pages/Parent.class
Binary file not shown.
Binary file not shown.