├── .idea ├── .gitignore ├── vcs.xml ├── encodings.xml ├── misc.xml ├── uiDesigner.xml ├── dbnavigator.xml └── workspace.xml ├── slides └── Selenide Turkce pdf.pdf ├── src ├── main │ └── java │ │ └── org │ │ └── example │ │ └── Main.java └── test │ ├── resources │ └── features │ │ ├── 08_explicitwait.feature │ │ ├── 11_javascriptexecutor.feature │ │ ├── 05_alert.feature │ │ ├── 04_dropdown.feature │ │ ├── 06_iframe_multiplewindow.feature │ │ ├── 09_screenshots.feature │ │ ├── 01_navigations.feature │ │ ├── 07_actions.feature │ │ ├── 02_locators.feature │ │ ├── 03_checkbox_radiobutton.feature │ │ └── 10_cross_browser.feature │ └── java │ ├── runners │ └── Runners.java │ ├── pages │ └── TestCenterPage.java │ └── stepdefinitions │ ├── CommonStepDefinitions.java │ └── TestCenterStepDefinitions.java ├── .gitignore └── pom.xml /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /slides/Selenide Turkce pdf.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abayramus/selenide-projem/HEAD/slides/Selenide Turkce pdf.pdf -------------------------------------------------------------------------------- /src/main/java/org/example/Main.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world!"); 6 | } 7 | } -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/features/08_explicitwait.feature: -------------------------------------------------------------------------------- 1 | Feature: explicit wait 2 | @explicitwait 3 | Scenario: explicit wait 4 | Given kullanici "https://the-internet.herokuapp.com/dynamic_loading/1" adresine gider 5 | And start butonuna tiklar 6 | Then kullanici "Hello World!" metnini dogrular 7 | Then sayfayi acik tutar -------------------------------------------------------------------------------- /src/test/resources/features/11_javascriptexecutor.feature: -------------------------------------------------------------------------------- 1 | Feature: js executor 2 | 3 | @scrollwithjs 4 | Scenario: js executor 5 | 6 | Given kullanici "https://www.amazon.com/" adresine gider 7 | And tum ekran goruntusunu alir 8 | And footer elementi gorunur sekilde goster 9 | And tum ekran goruntusunu alir 10 | Then sayfayi acik tutar 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/features/05_alert.feature: -------------------------------------------------------------------------------- 1 | Feature: alerts 2 | 3 | @alert 4 | Scenario: TC01 alert 5 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=javascript-alerts" adresine gider 6 | And alert prompt butonuna tiklar 7 | And kullanici alerte "nasilsin" metnini yazar ve OK e tiklar 8 | Then kullanici sonucun "nasilsin" icerdigini dogrular 9 | -------------------------------------------------------------------------------- /src/test/resources/features/04_dropdown.feature: -------------------------------------------------------------------------------- 1 | @dropdown 2 | Feature: dropdown 3 | Scenario: TC01 dropdown 4 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=dropdown" adresine gider 5 | And kullanici yil olarak 1998, ay olarak "July", gun olarak 25 6 | # And kullanici yil olarak 2000 secer 7 | # And kullanici ay olarak "June" secer 8 | # And kullanici gun olarak 15 secer -------------------------------------------------------------------------------- /src/test/resources/features/06_iframe_multiplewindow.feature: -------------------------------------------------------------------------------- 1 | Feature: iframe _ windows 2 | 3 | @iframe 4 | Scenario: TC01 iframe ve window 5 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=iframe" adresine gider 6 | And switch to frame 1 7 | And kullanici back to techproeducation.com linkine tiklar 8 | And switch to window 2 9 | Then sayfayi acik tutar 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/features/09_screenshots.feature: -------------------------------------------------------------------------------- 1 | @ekrangoruntusu 2 | Feature: screenshots 3 | 4 | @tumekrangoruntusu 5 | Scenario: tum ekran goruntusu 6 | Given kullanici "https://www.google.com/" adresine gider 7 | And tum ekran goruntusunu alir 8 | 9 | @googleimage 10 | Scenario: belirli elemenetin ekran goruntusu 11 | Given kullanici "https://www.google.com/" adresine gider 12 | And google image goruntusunu al 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/features/01_navigations.feature: -------------------------------------------------------------------------------- 1 | @google 2 | Feature: navigasyonlar 3 | Scenario: TC 01 navigasyon testi 4 | Given kullanici "https://www.google.com/" adresine gider 5 | And 5 saniye bekler 6 | Then kullanici "https://www.amazon.com/" adresine gider 7 | And 5 saniye bekler 8 | Then onceki sayfaya gider 9 | And 5 saniye bekler 10 | Then sonraki sayfaya gider 11 | And 5 saniye bekler 12 | Then sayfayi yeniler 13 | And 5 saniye bekler 14 | Then sayfayi acik tutar -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/features/07_actions.feature: -------------------------------------------------------------------------------- 1 | Feature: actions 2 | @draganddrop 3 | Scenario: TC01 drag and drop 4 | Given kullanici "https://jqueryui.com/droppable/" adresine gider 5 | And switch to frame 1 6 | And kullanici source elementi target elementine surukler 7 | Then sayfayi acik tutar 8 | 9 | @dropanddropby 10 | Scenario: TC02 drag and drop by 11 | Given kullanici "https://jqueryui.com/droppable/" adresine gider 12 | And switch to frame 1 13 | And kullanici source elementini 300 by 10 koordinatlarina surukler 14 | And verilen coordinatlara 300 by 10 suruklendigini dogrular 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store 39 | 40 | /build -------------------------------------------------------------------------------- /src/test/java/runners/Runners.java: -------------------------------------------------------------------------------- 1 | package runners; 2 | import io.cucumber.junit.Cucumber; 3 | import io.cucumber.junit.CucumberOptions; 4 | import org.junit.runner.RunWith; 5 | 6 | @RunWith(Cucumber.class) 7 | @CucumberOptions( 8 | plugin = { 9 | "pretty", 10 | "html:target/default-cucumber-reports.html", 11 | "json:target/json-reports/cucumber.json", 12 | "junit:target/xml-report/cucumber.xml", 13 | }, 14 | monochrome=true, 15 | features = "./src/test/resources/features", 16 | glue = {"stepdefinitions"}, 17 | dryRun = false, 18 | tags = "@scrollwithjs" 19 | 20 | ) 21 | public class Runners { 22 | } -------------------------------------------------------------------------------- /src/test/resources/features/02_locators.feature: -------------------------------------------------------------------------------- 1 | @locators 2 | Feature: locators 3 | Scenario: TC01 locators 4 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=form-authentication" adresine gider 5 | And 3 saniye bekler 6 | And kullanici adini gir 7 | And 3 saniye bekler 8 | And kullanici sifresini gir 9 | And 3 saniye bekler 10 | When submit buttonuna tikla 11 | And 5 saniye bekler 12 | Then giris yapildigini test et 13 | 14 | # 1. feature file olustur 15 | # 2. test caseleri yaz 16 | # 3. yeni test adimlari icin yeni bir step definition class olustur ve step definitions(java metotlari) olustur 17 | # 4. Page class olustur pages klasorunun altinda 18 | # 5. kullaniciAdi, sifresi ve submit butonunu o sayfada bul 19 | # 20 | 21 | -------------------------------------------------------------------------------- /src/test/resources/features/03_checkbox_radiobutton.feature: -------------------------------------------------------------------------------- 1 | Feature: checkbox ve radio button 2 | @checkbox 3 | Scenario: TC01 checkbox 4 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=checkboxes" adresine gider 5 | And "Checkbox 1" secili degilse sec 6 | And "Checkbox 2" secili degilse sec 7 | And sayfayi acik tutar 8 | 9 | 10 | @red 11 | Scenario: TC02 radio 12 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=radio-buttons" adresine gider 13 | And "Red" secili degilse sec 14 | And sayfayi acik tutar 15 | 16 | @football 17 | Scenario: TC03 radio 18 | Given kullanici "https://testcenter.techproeducation.com/index.php?page=radio-buttons" adresine gider 19 | And "Football" secili degilse sec 20 | And sayfayi acik tutar 21 | -------------------------------------------------------------------------------- /src/test/resources/features/10_cross_browser.feature: -------------------------------------------------------------------------------- 1 | @crossbrowser 2 | Feature: cross browser 3 | @headless 4 | Scenario: TC01 headless 5 | Given kullanici browser tipini "headless" olarak secer 6 | Given kullanici "https://www.amazon.com/" adresine gider 7 | Then tum ekran goruntusunu alir 8 | 9 | @firefox 10 | Scenario: TC02 firefox 11 | Given kullanici browser tipini "firefox" olarak secer 12 | Given kullanici "https://www.amazon.com/" adresine gider 13 | Then tum ekran goruntusunu alir 14 | 15 | @safari 16 | Scenario: TC03 safari - windowsda fail 17 | Given kullanici browser tipini "safari" olarak secer 18 | Given kullanici "https://www.amazon.com/" adresine gider 19 | Then tum ekran goruntusunu alir 20 | 21 | @edge 22 | Scenario: TC04 edge - macde fail 23 | Given kullanici browser tipini "edge" olarak secer 24 | Given kullanici "https://www.amazon.com/" adresine gider 25 | Then tum ekran goruntusunu alir 26 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.example 8 | selenide-projem 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 8 13 | 8 14 | UTF-8 15 | 16 | 17 | 18 | 19 | 20 | 21 | io.cucumber 22 | cucumber-java 23 | 7.11.2 24 | 25 | 26 | 27 | io.cucumber 28 | cucumber-junit 29 | 7.11.2 30 | test 31 | 32 | 33 | 34 | 35 | com.codeborne 36 | selenide 37 | 6.13.0 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/test/java/pages/TestCenterPage.java: -------------------------------------------------------------------------------- 1 | package pages; 2 | 3 | import com.codeborne.selenide.SelenideElement; 4 | import org.openqa.selenium.By; 5 | import static com.codeborne.selenide.Selenide.$; 6 | 7 | public class TestCenterPage { 8 | // kullanici adi 9 | public SelenideElement kullaniciAdi = $(By.id("exampleInputEmail1")); 10 | // kullanici sifresi 11 | public SelenideElement kullaniciSifresi = $("#exampleInputPassword1"); 12 | // submit butonu 13 | public SelenideElement submitButton = $(By.xpath("//button[@type='submit']")); 14 | // giris mesaji 15 | public SelenideElement girisMesaji = $(By.xpath("//*[contains(text(),'You logged into a secure area!')]")); 16 | 17 | // CHECKBOX ELEMENTLERI 18 | public SelenideElement checkbox1 = $(By.id("box1")); 19 | public SelenideElement checkbox2 = $(By.id("box2")); 20 | 21 | // RADIO ELEMENTLERI 22 | public SelenideElement red = $(By.id("red")); 23 | public SelenideElement football = $(By.id("football")); 24 | 25 | // DROPDOWN ELEMENTLERI 26 | public SelenideElement yil = $(By.id("year")); 27 | public SelenideElement ay = $(By.id("month")); 28 | public SelenideElement gun = $(By.id("day")); 29 | 30 | // ALERT ELEMENTLERI 31 | public SelenideElement promptButton = $(By.xpath("//button[@onclick='jsPrompt()']")); 32 | public SelenideElement sonuc = $("#result"); 33 | 34 | // FRAME ELEMENTLERI 35 | public SelenideElement techProLink = $(By.xpath("//a[@type='button']")); 36 | 37 | // ACTIONS ELEMENTLERI 38 | public SelenideElement kaynak = $("#draggable"); 39 | public SelenideElement hedef = $("#droppable"); 40 | 41 | // EXPLICIT ELEMENTLERI 42 | public SelenideElement startButton = $(By.xpath("//div[@id='start']//button")); 43 | public SelenideElement helloWorld =$(By.xpath("//div[@id='finish']//h4")); 44 | 45 | // SCREENSHOT 46 | public SelenideElement googleImage = $(".lnXdpd"); 47 | 48 | // JS EXECUTOR 49 | public SelenideElement amazonFooter =$(".navFooterMoreOnAmazon"); 50 | 51 | 52 | } -------------------------------------------------------------------------------- /src/test/java/stepdefinitions/CommonStepDefinitions.java: -------------------------------------------------------------------------------- 1 | package stepdefinitions; 2 | 3 | import com.codeborne.selenide.Configuration; 4 | import com.codeborne.selenide.Selenide; 5 | import io.cucumber.java.en.And; 6 | import io.cucumber.java.en.Given; 7 | import io.cucumber.java.en.Then; 8 | 9 | import java.util.Date; 10 | 11 | import static com.codeborne.selenide.Selenide.*; 12 | 13 | public class CommonStepDefinitions { 14 | 15 | @Given("kullanici {string} adresine gider") 16 | public void kullanici_adresine_gider(String string) { 17 | open(string); 18 | } 19 | @Then("{int} saniye bekler") 20 | public void saniye_bekler(Integer int1) { 21 | // selenide default olarak 4 saniye bekler 22 | // 4 saniyeden fazla beklemek icin sleep metotu kullanilir 23 | // sleep foncsiyonu millisecond kabul eder. saniyeye cevirmek icin 1000 ile carpilir 24 | sleep(int1*1000); 25 | } 26 | @Then("onceki sayfaya gider") 27 | public void onceki_sayfaya_gider() { 28 | back(); 29 | } 30 | @Then("sonraki sayfaya gider") 31 | public void sonraki_sayfaya_gider() { 32 | forward(); 33 | } 34 | @Then("sayfayi yeniler") 35 | public void sayfayi_yeniler() { 36 | refresh(); 37 | } 38 | @Then("sayfayi acik tutar") 39 | public void sayfayi_acik_tutar() { 40 | // Varyasilan selenide ayarlarinda, browser otomatik kapanmakdadir 41 | // Configuration.holdBrowserOpen=false;//VARSAYILAN 42 | Configuration.holdBrowserOpen=true; 43 | } 44 | 45 | @And("tum ekran goruntusunu alir") 46 | public void tumEkranGoruntusunuAlir() { 47 | screenshot(new Date().toString());//ekran goruntusune dinamik isim verildi 48 | // screenshot("image");//ekran goruntusune dinamik isim verilmedi 49 | } 50 | 51 | @Given("kullanici browser tipini {string} olarak secer") 52 | public void kullaniciBrowserTipiniOlarakSecer(String browserTipi) { 53 | switch (browserTipi){ 54 | case "headless": 55 | Configuration.headless=true; 56 | break; 57 | 58 | case "firefox": 59 | Configuration.browser="firefox"; 60 | break; 61 | 62 | case "safari": 63 | Configuration.browser ="safari"; 64 | break; 65 | 66 | case "opera": 67 | Configuration.browser ="opera"; 68 | break; 69 | 70 | case "edge": 71 | Configuration.browser ="edge"; 72 | break; 73 | 74 | default: 75 | Configuration.browser="chrome"; 76 | break; 77 | 78 | } 79 | 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/test/java/stepdefinitions/TestCenterStepDefinitions.java: -------------------------------------------------------------------------------- 1 | package stepdefinitions; 2 | 3 | 4 | import com.codeborne.selenide.Selenide; 5 | 6 | import io.cucumber.java.en.And; 7 | import io.cucumber.java.en.Given; 8 | import io.cucumber.java.en.Then; 9 | import io.cucumber.java.en.When; 10 | import org.junit.Assert; 11 | import pages.TestCenterPage; 12 | 13 | import java.time.Duration; 14 | 15 | import static com.codeborne.selenide.Condition.*; 16 | import static com.codeborne.selenide.Selenide.*; 17 | import static com.codeborne.selenide.WebDriverRunner.url; 18 | import static java.lang.Thread.sleep; 19 | 20 | public class TestCenterStepDefinitions { 21 | 22 | TestCenterPage testCenterPage = new TestCenterPage(); 23 | @Given("kullanici adini gir") 24 | public void kullanici_adini_gir() { 25 | testCenterPage.kullaniciAdi.setValue("techproed"); 26 | } 27 | @Given("kullanici sifresini gir") 28 | public void kullanici_sifresini_gir() { 29 | testCenterPage.kullaniciSifresi.setValue("SuperSecretPassword"); 30 | 31 | } 32 | @When("submit buttonuna tikla") 33 | public void submit_buttonuna_tikla() { 34 | testCenterPage.submitButton.click(); 35 | } 36 | @Then("giris yapildigini test et") 37 | public void giris_yapildigini_test_et() { 38 | // Assert.assertTrue(testCenterPage.girisMesaji.isDisplayed());//JUNIT 39 | // testCenterPage.girisMesaji.shouldBe(Condition.visible); 40 | testCenterPage.girisMesaji.shouldBe(visible);// SELENIDE ASSERTION. 41 | // FAIL EDERSE EKRAN GORUNTUSU OTOMATIK OLARAK ALINIR VE build DOSYASINA KAYDEDILIR 42 | } 43 | //DROPDOWN STEP DEFS 44 | @And("{string} secili degilse sec") 45 | public void seciliDegilseSec(String text) { 46 | 47 | // eger text = Checkbox 1 VE checkbox 1 secili degise, checkbox1 e tikla 48 | if (text.equals("Checkbox 1") && !testCenterPage.checkbox1.isSelected()){ 49 | testCenterPage.checkbox1.click(); 50 | // Assert.assertTrue(testCenterPage.checkbox1.isSelected());//junit 51 | // testCenterPage.checkbox1.shouldBe(Condition.checked);//selenide uzun version 52 | testCenterPage.checkbox1.shouldBe(checked);//selenide kisa version 53 | } 54 | if (text.equals("Checkbox 2") && !testCenterPage.checkbox2.isSelected()) { 55 | testCenterPage.checkbox2.shouldNotBe(checked); 56 | testCenterPage.checkbox2.click(); 57 | testCenterPage.checkbox2.shouldBe(checked); 58 | } 59 | if (text.equals("Red")&& !testCenterPage.red.isSelected()){ 60 | testCenterPage.red.shouldNotBe(checked);//secili olmadigini test et 61 | testCenterPage.red.click();//sec 62 | testCenterPage.red.shouldBe(checked);//secili oldugunu test et 63 | } 64 | 65 | if (text.equals("Football")&& !testCenterPage.football.isSelected()){ 66 | testCenterPage.football.shouldNotBe(checked);//secili olmadigini test et 67 | testCenterPage.football.click();//sec 68 | testCenterPage.football.shouldBe(checked);//secili oldugunu test et 69 | } 70 | 71 | 72 | 73 | } 74 | 75 | @And("kullanici yil olarak {int}, ay olarak {string}, gun olarak {int}") 76 | public void kullaniciYilOlarakAyOlarakGunOlarak(int yil, String ay, int gun) throws InterruptedException { 77 | // testCenterPage.yil.selectOption(2000);//INDEX = 2000. MAKUL DEGIL. 78 | // testCenterPage.yil.selectOption(String.valueOf(yil));//METIN = "2000". CALISIR 79 | testCenterPage.yil.selectOptionByValue(String.valueOf(yil));//VALUE = "2000". CALISIR 80 | 81 | sleep(3000); //HARD WAIT 82 | Selenide.sleep(3000); 83 | 84 | testCenterPage.ay.selectOption(ay);//GORUNEN METIN ILE SEC ="June". POPULER. 85 | 86 | sleep(3000); 87 | 88 | testCenterPage.gun.selectOption(gun-1);//INDEX = 25-1 = 24. BU 25. gunu secer. 89 | 90 | sleep(3000); 91 | 92 | 93 | 94 | } 95 | 96 | // ALERT STEP DEFS 97 | @And("alert prompt butonuna tiklar") 98 | public void alertPromptButonunaTiklar() { 99 | testCenterPage.promptButton.click(); 100 | } 101 | 102 | @And("kullanici alerte {string} metnini yazar ve OK e tiklar") 103 | public void kullaniciAlerteMetniniYazarVeOKETiklar(String arg0) throws InterruptedException { 104 | switchTo().alert().sendKeys(arg0);//Alerte FF gelen metni girelim 105 | sleep(3000); 106 | switchTo().alert().accept();//OK e tiklayalim 107 | sleep(3000); 108 | // Selenide.sleep(3000);//SELENIDE SLEEP. DINAMIC. 109 | // Thread.sleep(3000);//JAVA SLEEP. HARD. 3 SANIYE BEKLE. 110 | } 111 | 112 | @Then("kullanici sonucun {string} icerdigini dogrular") 113 | public void kullaniciSonucunIcerdiginiDogrular(String arg0) { 114 | testCenterPage.sonuc.shouldHave(text(arg0));//FF dan gelen metnin sonuc elementinde icerildigi dogrula.Tercih edilen. 115 | // Assert.assertTrue(testCenterPage.sonuc.getText().contains(arg0));//JUNIT ILE DE ASSERT EILEBILIR. 116 | } 117 | 118 | @And("switch to frame {int}") 119 | public void switchToFrame(int frame) { 120 | switchTo().frame(frame-1);//1-1 = 0. index = 1. iframe 121 | } 122 | 123 | @And("kullanici back to techproeducation.com linkine tiklar") 124 | public void kullaniciBackToTechproeducationComLinkineTiklar() throws InterruptedException { 125 | testCenterPage.techProLink.click(); 126 | System.out.println("TechPro Linkine Tiklandi ve Yeni pencere acildi"); 127 | Thread.sleep(3000); 128 | // System.out.println("SAYFA URL I : "+ WebDriverRunner.url());//DRIVER HALA TEST PAGE DE 129 | System.out.println("SAYFA URL I : "+ url());//DRIVER HALA TEST PAGE DE 130 | } 131 | 132 | @And("switch to window {int}") 133 | public void switchToWindow(int targetWindow) throws InterruptedException { 134 | switchTo().window(targetWindow-1, Duration.ofSeconds(5));// INDEX. Duration.ofSeconds(5)) zorunlu degil 135 | System.out.println("Yeni pencereye gecil yapildi"); 136 | Thread.sleep(3000); 137 | System.out.println("YENI SAYFA URL I : "+url());//YENI SAYFA URL NI VERECEKDIR 138 | } 139 | 140 | @And("kullanici source elementi target elementine surukler") 141 | public void kullaniciSourceElementiTargetElementineSurukler() { 142 | // SELENIUM 143 | // Actions actions = new Actions(); 144 | // SELENIDE KISACA actions() 145 | 146 | // 1. dragAndDrop 147 | actions() 148 | .dragAndDrop(testCenterPage.kaynak,testCenterPage.hedef)//kaynak elementi hedefe surukle 149 | .build()//baglantiyi olustur(OPTIONAL) 150 | .perform();//verilen komutlari yap(ZORUNLU) 151 | 152 | } 153 | 154 | 155 | @And("kullanici source elementini {int} by {int} koordinatlarina surukler") 156 | public void kullaniciSourceElementiniByKoordinatlarinaSurukler(int arg0, int arg1) { 157 | actions() 158 | .dragAndDropBy(testCenterPage.kaynak,arg0,arg1) 159 | .build() 160 | .perform(); 161 | } 162 | 163 | @And("verilen coordinatlara {int} by {int} suruklendigini dogrular") 164 | public void verilenCoordinatlaraBySuruklendiginiDogrular(int arg0, int arg1) { 165 | String styleValue = testCenterPage.kaynak.getAttribute("style"); 166 | System.out.println(styleValue); 167 | Assert.assertTrue(styleValue.contains(String.valueOf(arg0))&&styleValue.contains(String.valueOf(arg1))); 168 | } 169 | 170 | @And("start butonuna tiklar") 171 | public void startButonunaTiklar() { 172 | testCenterPage.startButton.click(); 173 | } 174 | 175 | @Then("kullanici {string} metnini dogrular") 176 | public void kullaniciMetniniDogrular(String arg0) { 177 | // Assert.assertEquals(arg0,testCenterPage.helloWorld.getText());//FAIL. WAIT PROBLEMI. 178 | 179 | // 1. WebDriverWait 180 | // WebDriverWait wait = new WebDriverWait(WebDriverRunner.getWebDriver(),Duration.ofSeconds(10)); 181 | // wait.until(ExpectedConditions.visibilityOf(testCenterPage.helloWorld));//EXPLICIT WAIT 182 | // Assert.assertEquals(arg0,testCenterPage.helloWorld.getText());//PASS. EXPLICIT WAIT ILE PROBLEM COZULDU 183 | 184 | // 2. Selenide Wait 185 | // testCenterPage.helloWorld.should(visible,Duration.ofSeconds(10));//SELENIDE WAIT 186 | // Assert.assertEquals(arg0,testCenterPage.helloWorld.getText()); 187 | 188 | 189 | // 3. Selenide Wait 190 | testCenterPage.helloWorld.shouldHave(text("Hello World!"),Duration.ofSeconds(10));//SELENIDE WAIT 191 | } 192 | 193 | 194 | @And("google image goruntusunu al") 195 | public void googleImageGoruntusunuAl() { 196 | testCenterPage.googleImage.screenshot(); 197 | } 198 | 199 | @And("footer elementi gorunur sekilde goster") 200 | public void footerElementiGorunurSekildeGoster() { 201 | // testCenterPage.amazonFooter 202 | executeJavaScript("arguments[0].scrollIntoView(true);",testCenterPage.amazonFooter); 203 | 204 | 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.idea/dbnavigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 174 | 175 | 180 | 181 | 182 | 184 | 185 | 186 | 187 | 188 | 189 | 191 | { 192 | "keyToString": { 193 | "RunOnceActivity.OpenProjectViewOnStart": "true", 194 | "RunOnceActivity.ShowReadmeOnStart": "true", 195 | "settings.editor.selected.configurable": "preferences.pluginManager" 196 | } 197 | } 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 224 | 225 | 244 | 245 | 264 | 265 | 284 | 285 | 286 | 287 | 288 | 291 | 292 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 1681202383315 314 | 318 | 319 | 320 | --------------------------------------------------------------------------------