From bf3f15660d15a69169e4781f5f96d65c0b602b9e Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Wed, 4 Apr 2018 22:54:17 -0500 Subject: [PATCH 01/14] replace gradle with maven for an alternate example --- .gitignore | 1 + build.gradle | 16 ---------------- pom.xml | 16 ++++++++++++++++ settings.gradle | 2 -- 4 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 build.gradle create mode 100644 pom.xml delete mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 06c1b6a..6695bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle/ +target/ .idea/ build/ gradle/ diff --git a/build.gradle b/build.gradle deleted file mode 100644 index dc2871b..0000000 --- a/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -group 'io.testable' -version '0.1.0-SNAPSHOT' - -apply plugin: 'java' -apply plugin: 'application' - -mainClassName = "io.testable.selenium.TestableExample" - -repositories { - mavenCentral() -} - -dependencies { - compile group:'io.testable', name: 'testable-selenium-java', version: '0.0.2' - testCompile group: 'junit', name: 'junit', version: '4.11' -} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..51355b8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + io.testable + selenium-java-example + 0.0.1-SNAPSHOT + + + io.testable + testable-selenium-java + 0.0.2 + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 8369239..0000000 --- a/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'testable-selenium-java-example' - From d3189e88094a427f86c8ff8580cb63dc0637b732 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Fri, 6 Apr 2018 23:02:26 -0500 Subject: [PATCH 02/14] update readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 029140a..1e0484c 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ Examples showing how to utilize [testable-selenium-java](https://github.com/testable/testable-selenium-java). + +When running on Testable, if the project source is uploaded as a zip file +or linked to version control either Gradle or Mabe used to do a build +by auto-detecting a build.gradle or pom.xml file +in the root of the repository. If both are detected, Gradle will be used. + +Testable will run the main class specified in the scenario on the test runner. \ No newline at end of file From c41c322f36424ac9f55658764faeff3b8a2f3f9b Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Wed, 25 Apr 2018 11:42:25 -0500 Subject: [PATCH 03/14] update to testable-selenium 0.0.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 51355b8..771cecb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.testable testable-selenium-java - 0.0.2 + 0.0.3 - \ No newline at end of file + From fcd7999eefdb6b2f5f3ef57058df4ae49b8e0eea Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 29 Apr 2019 21:10:11 -0500 Subject: [PATCH 04/14] fix deps --- build.gradle | 13 ------------- pom.xml | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 build.gradle diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 167be77..0000000 --- a/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -group 'io.testable' -version '0.1.0-SNAPSHOT' - -apply plugin: 'java' - -repositories { - mavenCentral() -} - -dependencies { - compile group:'io.testable', name: 'testable-selenium-java', version: '0.0.4' - testCompile group: 'junit', name: 'junit', version: '4.11' -} diff --git a/pom.xml b/pom.xml index 771cecb..849d591 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.testable testable-selenium-java - 0.0.3 + 0.0.4 From f849fddf9704a2c4c5a84000475c94d00ee29af0 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 20 Jul 2020 13:06:50 -0500 Subject: [PATCH 05/14] Update testable-selenium-java to 0.0.9 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 849d591..ba6b183 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.testable testable-selenium-java - 0.0.4 + 0.0.9 From 02e2b7d9aad0ee27365cb64b3cd60ccbcbd401ab Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Sat, 9 Jan 2021 13:26:33 -0600 Subject: [PATCH 06/14] testable-selenium-java version update --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 849d591..ba6b183 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.testable testable-selenium-java - 0.0.4 + 0.0.9 From 2c462a40620623ff10a18f7832a1349cd2cea0dd Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Sun, 10 Jan 2021 01:29:06 -0600 Subject: [PATCH 07/14] update example to testable-selenium-java 0.0.11 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ba6b183..d8dbea5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ io.testable testable-selenium-java - 0.0.9 + 0.0.11 From f6988e27592c0075140038cb507e684a12ec4e77 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Sun, 24 Jan 2021 12:43:42 -0600 Subject: [PATCH 08/14] 0.0.12 testable-selenium-java --- pom.xml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d8dbea5..776a3cc 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,42 @@ io.testable testable-selenium-java - 0.0.11 + 0.0.12 + + + org.testng + testng + 6.14.3 + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + + + + io.testable.selenium.TestableExample + + + + + jar-with-dependencies + + + + + + + + + From 60f4dc120c297423f6de4eaddb1fdfce70aab0f1 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:01:08 -0500 Subject: [PATCH 09/14] log perf log --- .../io/testable/selenium/TestableExample.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 7c19de8..308f9ff 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -2,6 +2,12 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeOptions; +import org.openqa.selenium.logging.LogEntries; +import org.openqa.selenium.logging.LogEntry; +import org.openqa.selenium.logging.LogType; +import org.openqa.selenium.logging.LoggingPreferences; + +import java.util.logging.Level; /** * Simple example of loading Google and taking a screenshot in a way that is compatible with the Testable platform. @@ -9,10 +15,19 @@ public class TestableExample { public static void main(String[] args) { + LoggingPreferences logPrefs = new LoggingPreferences(); + logPrefs.enable(LogType.PERFORMANCE, Level.ALL); ChromeOptions options = new ChromeOptions(); + options.setCapability("goog:loggingPerfs", logPrefs); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); TestableSelenium.takeScreenshot(driver, "temp.png"); + + LogEntries logEntries = driver.manage().logs().get(LogType.PERFORMANCE); + for (LogEntry entry : logEntries) { + System.out.println(entry.toString()); + } + driver.close(); } From af89cb2234e0ca7826cf56553cfa06b0b4debc5c Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:09:45 -0500 Subject: [PATCH 10/14] log perf log --- src/main/java/io/testable/selenium/TestableExample.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 308f9ff..71fd6ee 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -6,6 +6,7 @@ import org.openqa.selenium.logging.LogEntry; import org.openqa.selenium.logging.LogType; import org.openqa.selenium.logging.LoggingPreferences; +import org.openqa.selenium.remote.CapabilityType; import java.util.logging.Level; @@ -18,7 +19,7 @@ public static void main(String[] args) { LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); ChromeOptions options = new ChromeOptions(); - options.setCapability("goog:loggingPerfs", logPrefs); + options.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); TestableSelenium.takeScreenshot(driver, "temp.png"); From bec2f70218e0cc34be139322a83681b61c7acae0 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:12:25 -0500 Subject: [PATCH 11/14] log perf log --- src/main/java/io/testable/selenium/TestableExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 71fd6ee..4af27be 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -6,8 +6,8 @@ import org.openqa.selenium.logging.LogEntry; import org.openqa.selenium.logging.LogType; import org.openqa.selenium.logging.LoggingPreferences; -import org.openqa.selenium.remote.CapabilityType; +import java.util.Collections; import java.util.logging.Level; /** @@ -19,7 +19,7 @@ public static void main(String[] args) { LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); ChromeOptions options = new ChromeOptions(); - options.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); + options.setCapability("goog:loggingPerfs", Collections.singletonMap(LogType.PERFORMANCE, Level.ALL.toString())); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); TestableSelenium.takeScreenshot(driver, "temp.png"); From 52679ec7e9dec208bdafe87972a70fb7ca1adfc0 Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:18:10 -0500 Subject: [PATCH 12/14] log perf log --- src/main/java/io/testable/selenium/TestableExample.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 4af27be..6f7296a 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -19,6 +19,7 @@ public static void main(String[] args) { LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); ChromeOptions options = new ChromeOptions(); + options.setExperimentalOption("w3c", false); options.setCapability("goog:loggingPerfs", Collections.singletonMap(LogType.PERFORMANCE, Level.ALL.toString())); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); From a83fe01af061e0ff824467dc77860401ed42125b Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:24:57 -0500 Subject: [PATCH 13/14] log perf log --- src/main/java/io/testable/selenium/TestableExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 6f7296a..3da5d1f 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -6,6 +6,7 @@ import org.openqa.selenium.logging.LogEntry; import org.openqa.selenium.logging.LogType; import org.openqa.selenium.logging.LoggingPreferences; +import org.openqa.selenium.remote.DesiredCapabilities; import java.util.Collections; import java.util.logging.Level; @@ -18,8 +19,7 @@ public class TestableExample { public static void main(String[] args) { LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); - ChromeOptions options = new ChromeOptions(); - options.setExperimentalOption("w3c", false); + DesiredCapabilities options = DesiredCapabilities.chrome(); options.setCapability("goog:loggingPerfs", Collections.singletonMap(LogType.PERFORMANCE, Level.ALL.toString())); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); From 5bb56bad172c2929463b5618e1db140e33af2cbf Mon Sep 17 00:00:00 2001 From: Avi Stramer Date: Mon, 10 May 2021 15:26:32 -0500 Subject: [PATCH 14/14] log perf log --- src/main/java/io/testable/selenium/TestableExample.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/testable/selenium/TestableExample.java b/src/main/java/io/testable/selenium/TestableExample.java index 3da5d1f..dd911eb 100644 --- a/src/main/java/io/testable/selenium/TestableExample.java +++ b/src/main/java/io/testable/selenium/TestableExample.java @@ -20,12 +20,12 @@ public static void main(String[] args) { LoggingPreferences logPrefs = new LoggingPreferences(); logPrefs.enable(LogType.PERFORMANCE, Level.ALL); DesiredCapabilities options = DesiredCapabilities.chrome(); - options.setCapability("goog:loggingPerfs", Collections.singletonMap(LogType.PERFORMANCE, Level.ALL.toString())); + options.setCapability("goog:loggingPerfs", Collections.singletonMap(LogType.BROWSER, Level.ALL.toString())); WebDriver driver = TestableSelenium.newWebDriver(options); driver.get("https://www.google.com"); TestableSelenium.takeScreenshot(driver, "temp.png"); - LogEntries logEntries = driver.manage().logs().get(LogType.PERFORMANCE); + LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER); for (LogEntry entry : logEntries) { System.out.println(entry.toString()); }