You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-41Lines changed: 26 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ cd smartui-java-testng-sample
52
52
You can also run the command below to check for outdated dependencies.
53
53
54
54
```bash
55
-
mvn versions:display-dependency-updates
55
+
mvn clean compile
56
56
```
57
57
58
58
### Setting Up Your Authentication
@@ -64,41 +64,47 @@ Make sure you have your LambdaTest credentials with you to run test automation s
64
64
- For **Linux/macOS**:
65
65
66
66
```bash
67
+
export PROJECT_TOKEN="xxxxx#java-sdk-testing"
67
68
export LT_USERNAME="YOUR_USERNAME"
68
69
export LT_ACCESS_KEY="YOUR ACCESS KEY"
69
70
```
70
71
71
72
- For **Windows**:
72
73
73
74
```bash
75
+
set PROJECT_TOKEN="xxxxx#java-sdk-testing"
74
76
set LT_USERNAME="YOUR_USERNAME"
75
77
set LT_ACCESS_KEY="YOUR ACCESS KEY"
76
78
```
77
79
78
-
##Run Your First Test
80
+
### Execute SmartUI Java Tests using smartui-cli
79
81
80
-
> **Test Scenario**: The sample [TestNGTodo1.java](https://github.com/LambdaTest/Java-TestNG-Selenium/blob/master/src/test/java/com/lambdatest/TestNGTodo1.java) tests a sample to-do list app by marking couple items as done, adding a new item to the list and finally displaying the count of pending items as output.
81
82
82
-
### Configuring Your Test Capabilities
83
+
#### Install the smartui-cli dependencies
84
+
```bash
85
+
npm i @lambdatest/smartui-cli
86
+
```
83
87
84
-
**Step 3:** In the test script, you need to update your test capabilities. In this code, we are passing browser, browser version, and operating system information, along with LambdaTest Selenium grid capabilities via capabilities object. The capabilities object in the above code are defined as:
npx smartui exec -- mvn test -D suite=sdk-local.xml
96
+
```
94
97
98
+
#### Use Lambdatest Cloud Hub
99
+
```bash
100
+
npx smartui exec -- mvn test -D suite=sdk-cloud.xml
95
101
```
96
102
97
-
You can generate capabilities for your test requirements with the help of our inbuilt [Desired Capability Generator](https://www.lambdatest.com/capabilities-generator/?utm_source=github&utm_medium=repo&utm_campaign=Java-TestNG-Selenium).
103
+
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on SmartUI dashboard.
98
104
99
-
### Executing The SmartUI Test
105
+
### Executing SmartUI Test on Lambdatest Hub without smartui-cli
100
106
101
-
**Step 4:**The tests can be executed in the terminal using the following command.
107
+
The tests can be executed in the terminal using the following command.
102
108
103
109
```bash
104
110
mvn test -D suite=smartui.xml
@@ -108,35 +114,14 @@ Your test results would be displayed on the test console (or command-line interf
108
114
109
115
## Run Parallel SmartUI Tests Using TestNG
110
116
111
-
Here is an example `xml` file which would help you to run a single test on various browsers at the same time, you would also need to generate a testcase which makes use of **TestNG** framework parameters (`org.testng.annotations.Parameters`).
112
-
113
-
```xml title="smartui-parallel.xml"
114
-
<?xml version="1.0" encoding="UTF-8"?>
115
-
<!DOCTYPEsuite SYSTEM "http://testng.org/testng-1.0.dtd">
0 commit comments