From b8acbd08078ec55d5c1735b4ad19534771539dea Mon Sep 17 00:00:00 2001 From: Sirajuddin Khan Date: Mon, 31 Jul 2023 12:23:39 +0000 Subject: [PATCH 1/3] annotation Branch --- .gitpod.yml | 2 +- annotation.xml | 9 +++++++++ src/test/java/com/lambdatest/TestNGTodo2.java | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 annotation.xml diff --git a/.gitpod.yml b/.gitpod.yml index 2f1526e..01b3023 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,5 +5,5 @@ ports: # List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/config-start-tasks/ tasks: - - init: mvn install -Dsuite=parallel.xml # runs during prebuild + - init: mvn install -Dsuite=annotation.xml # runs during prebuild command: echo 'Please check your test on https://automation.lambdatest.com/' diff --git a/annotation.xml b/annotation.xml new file mode 100644 index 0000000..38a023f --- /dev/null +++ b/annotation.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/test/java/com/lambdatest/TestNGTodo2.java b/src/test/java/com/lambdatest/TestNGTodo2.java index 3530993..e4dcb81 100644 --- a/src/test/java/com/lambdatest/TestNGTodo2.java +++ b/src/test/java/com/lambdatest/TestNGTodo2.java @@ -50,7 +50,7 @@ Steps to run Smart UI project (https://beta-smartui.lambdatest.com/) String[] Tags = new String[] { "Feature", "Magicleap", "Severe" }; caps.setCapability("tags", Tags); - driver = new RemoteWebDriver(new URL("https://" + username + ":" + authkey + hub), caps); + driver = new RemoteWebDriver(new URL("https://sirajk:oz85RZKxbqX6X8aCQXuQgUDnojP8OwY3wx2SAkEswtgRuxl8n0@stage-hub.lambdatestinternal.com/wd/hub"), caps); } @Test @@ -58,9 +58,12 @@ public void basicTest() throws InterruptedException { String spanText; System.out.println("Loading Url"); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Loading URL\", \"level\": \"info\"}}"); driver.get("https://lambdatest.github.io/sample-todo-app/"); System.out.println("Checking Box"); + + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Marking Checkboxes\", \"level\": \"info\"}}"); driver.findElement(By.name("li1")).click(); System.out.println("Checking Another Box"); @@ -72,6 +75,7 @@ public void basicTest() throws InterruptedException { System.out.println("Checking Another Box"); driver.findElement(By.name("li4")).click(); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Adding List Items\", \"level\": \"info\"}}"); driver.findElement(By.id("sampletodotext")).sendKeys(" List Item 6"); driver.findElement(By.id("addbutton")).click(); @@ -81,6 +85,7 @@ public void basicTest() throws InterruptedException { driver.findElement(By.id("sampletodotext")).sendKeys(" List Item 8"); driver.findElement(By.id("addbutton")).click(); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Adding List Items\", \"level\": \"warn\"}}"); System.out.println("Checking Another Box"); driver.findElement(By.name("li1")).click(); @@ -93,11 +98,14 @@ public void basicTest() throws InterruptedException { System.out.println("Checking Another Box"); driver.findElement(By.name("li8")).click(); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Writing Todo\", \"level\": \"debug\"}}"); System.out.println("Entering Text"); driver.findElement(By.id("sampletodotext")).sendKeys("Get Taste of Lambda and Stick to It"); driver.findElement(By.id("addbutton")).click(); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Assert error\", \"level\": \"error\"}}"); + System.out.println("Checking Another Box"); driver.findElement(By.name("li9")).click(); From 694686bd6775f77512e996234d3543d1e6a379ba Mon Sep 17 00:00:00 2001 From: Sirajuddin Khan Date: Mon, 31 Jul 2023 12:23:54 +0000 Subject: [PATCH 2/3] annotation --- src/test/java/com/lambdatest/TestNGTodo2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/lambdatest/TestNGTodo2.java b/src/test/java/com/lambdatest/TestNGTodo2.java index e4dcb81..c4495eb 100644 --- a/src/test/java/com/lambdatest/TestNGTodo2.java +++ b/src/test/java/com/lambdatest/TestNGTodo2.java @@ -98,7 +98,7 @@ public void basicTest() throws InterruptedException { System.out.println("Checking Another Box"); driver.findElement(By.name("li8")).click(); - driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Writing Todo\", \"level\": \"debug\"}}"); + driver.executeScript("lambdatest_executor: {\"action\": \"stepcontext\", \"arguments\": {\"data\": \"Writing Todo\", \"level\": \"warn\"}}"); System.out.println("Entering Text"); driver.findElement(By.id("sampletodotext")).sendKeys("Get Taste of Lambda and Stick to It"); From 720d05496f78dbefd0cb5c6e925ba56f712aa20f Mon Sep 17 00:00:00 2001 From: Sirajuddin Khan Date: Wed, 1 May 2024 09:33:40 +0000 Subject: [PATCH 3/3] hub url --- src/test/java/com/lambdatest/TestNGTodo2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/lambdatest/TestNGTodo2.java b/src/test/java/com/lambdatest/TestNGTodo2.java index c4495eb..568796a 100644 --- a/src/test/java/com/lambdatest/TestNGTodo2.java +++ b/src/test/java/com/lambdatest/TestNGTodo2.java @@ -50,7 +50,7 @@ Steps to run Smart UI project (https://beta-smartui.lambdatest.com/) String[] Tags = new String[] { "Feature", "Magicleap", "Severe" }; caps.setCapability("tags", Tags); - driver = new RemoteWebDriver(new URL("https://sirajk:oz85RZKxbqX6X8aCQXuQgUDnojP8OwY3wx2SAkEswtgRuxl8n0@stage-hub.lambdatestinternal.com/wd/hub"), caps); + driver = new RemoteWebDriver(new URL("https://" + username + ":" + authkey + hub), caps); } @Test