This file contains hidden or 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
| package com.pragmatic.selenium.util; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.util.Properties; | |
| public class ConfigReader { | |
| private static Properties properties = new Properties(); |
This file contains hidden or 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
| package com.pragmatic.selenium.util; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.chrome.ChromeDriver; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.openqa.selenium.edge.EdgeDriver; | |
| import org.openqa.selenium.edge.EdgeOptions; | |
| import org.openqa.selenium.firefox.FirefoxDriver; | |
| import org.openqa.selenium.firefox.FirefoxOptions; | |
| import org.openqa.selenium.safari.SafariDriver; |
This file contains hidden or 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
| pipeline { | |
| agent any // Runs on any available agent | |
| stages { | |
| stage('Checkout') { | |
| steps { | |
| git url: 'https://github.com/pragmatictesters/selenium-sauce-demo.git', branch: 'main' | |
| } | |
| } |
This file contains hidden or 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
| //Working with the browser | |
| //Please refer to Selenium WebDriver API for available methods | |
| //https://www.selenium.dev/selenium/docs/api/java/index.html?overview-summary.html | |
| //1.1 Navigate to a URL | |
| WDS.browser.get("https://jmeter-plugins.org") | |
| //1.2 Get the page Title | |
| WDS.browser.getTitle() |
This file contains hidden or 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
| var pkg = JavaImporter(org.openqa.selenium) | |
| var time = JavaImporter(java.time) | |
| var support_ui = JavaImporter(org.openqa.selenium.support.ui); | |
| var wait = new support_ui.WebDriverWait(WDS.browser, time.Duration.ofSeconds(30)); | |
| WDS.sampleResult.sampleStart(); | |
| WDS.browser.findElement(pkg.By.cssSelector('#IncidentObject_Save')).click() | |
| waitUntilLoadingIsCompleted(); |
This file contains hidden or 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
| var pkg = JavaImporter(org.openqa.selenium) | |
| var time = JavaImporter(java.time) | |
| var support_ui = JavaImporter(org.openqa.selenium.support.ui); | |
| var wait = new support_ui.WebDriverWait(WDS.browser, time.Duration.ofSeconds(30)); | |
| WDS.sampleResult.sampleStart(); | |
| WDS.log.info("Start navigating to new bus incident creation page"); | |
| waitAndClick(pkg.By.cssSelector("#New")); | |
| waitAndClick(pkg.By.cssSelector("#BusIncident_3")); |
This file contains hidden or 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
| WDS.browser.manage().window().maximize() | |
| WDS.sampleResult.sampleStart(); | |
| WDS.log.info("Login page loading is started"); | |
| WDS.browser.get("${base_url}") | |
| WDS.log.info("Login page is loaded"); | |
| WDS.sampleResult.sampleEnd(); |
This file contains hidden or 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
| Feature: Login feature | |
| Scenario: Login as a standard user | |
| Given User has accessed the login page "https://www.saucedemo.com" | |
| When User type username "standard_user" | |
| And User type password "secret_sauce" | |
| And User click the login button | |
| Then User should be directed to inventory page "https://www.saucedemo.com/inventory.html" |
This file contains hidden or 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
| jobs: | |
| - job: Smoke_Staging_Tests | |
| displayName: Smoke tests on staging environment | |
| continueOnError: true | |
| pool: | |
| vmImage: "windows-2022" | |
| timeoutInMinutes: 180 | |
| steps: | |
| - script: npm install | |
| displayName: "Install TestCafe and other dependencies" |
This file contains hidden or 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
| package com.pragmatic.email; | |
| import com.mailosaur.MailosaurClient; | |
| import com.mailosaur.MailosaurException; | |
| import com.mailosaur.models.Link; | |
| import com.mailosaur.models.Message; | |
| import com.mailosaur.models.SearchCriteria; | |
| import io.github.bonigarcia.wdm.WebDriverManager; | |
| import org.openqa.selenium.By; | |
| import org.openqa.selenium.WebDriver; |
NewerOlder