This file contains 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 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 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 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 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 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 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 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; |
This file contains 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; | |
import io.github.bonigarcia.wdm.WebDriverManager; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.testng.annotations.Test; | |
public class HelloSelenium { |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.pragmatic</groupId> | |
<artifactId>selenium</artifactId> | |
<version>1.0-SNAPSHOT</version> |
NewerOlder