├── .gitignore
├── .gitpod.yml
├── README.md
├── conf
├── local.conf.js
├── multiple.conf.js
├── parallel.conf.js
└── single.conf.js
├── package.json
└── tests
└── specs
├── local_test.js
├── multiple
├── test_01.js
├── test_02.js
└── test_03.js
├── multiple_test.js
└── single_test.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | package-lock.json
3 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | # This configuration file was automatically generated by Gitpod.
2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3 | # and commit this file to your remote git repository to share the goodness with others.
4 |
5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6 |
7 | tasks:
8 | # - init: npm install
9 | - command: npm install; npm run single;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Run Selenium Tests With WebDriverIO 5.6.2 On LambdaTest
2 |
3 | 
4 |
5 |
6 | Blog
7 | ⋅
8 | Docs
9 | ⋅
10 | Learning Hub
11 | ⋅
12 | Newsletter
13 | ⋅
14 | Certifications
15 | ⋅
16 | YouTube
17 |
18 |
19 |
20 |
21 |
22 | *Learn how to use WebDriverIO 5.6.2 framework to configure and run your JavaScript automation testing scripts on the LambdaTest platform*
23 |
24 | [
](https://accounts.lambdatest.com/register)
25 |
26 | ## Table Of Contents
27 |
28 | * [Pre-requisites](#pre-requisites)
29 | * [Installing Selenium Dependencies](#installing-selenium-dependencies)
30 | * [Getting Started](#getting-started)
31 | * [Execute The Test](#execute-the-test)
32 |
33 | ## Pre-requisites
34 |
35 | Before getting started with Automated Scripts using Selenium with WebDriverIO 5.6.2 on LambdaTest Automation, you need to:
36 |
37 | * The first step is to download and install node.js and node package manager or npm. You should be having nodejs v6 or newer. Click [here](https://nodejs.org/en/) to download.
38 | * Make sure to use the latest version of JavaScript.
39 | * Make sure you have WD installed in your system, you can install it using the below command through npm:
40 |
41 | `npm install webdriverio`
42 |
43 | * Download [Selenium JavaScript bindings](http://www.seleniumhq.org/download/) from the official Selenium website.
44 | * Once you download the JavaScript bindings, extract the ZIP file which you’ve downloaded. * After extracting the file, you need to add Selenium Java bindings which is a JAR file and all the dependent libraries to your classpath.
45 |
46 | ## Installing Selenium Dependencies
47 |
48 | Next step is to install Selenium dependencies for Node.js using npm. Here’s the command to run:
49 |
50 | `npm i selenium-webdriver`
51 |
52 | * Download LambdaTest tunnel binary file if you wish to test your locally hosted or privately hosted projects.
53 |
54 | > Follow our documentation on LambdaTest tunnel to know it all. OS specific instructions to download and setup tunnel binary can be found at the following links.
55 | * [Documentation For Windows User](https://www.lambdatest.com/support/docs/local-testing-windows/)
56 | * [Documentation For Mac User](https://www.lambdatest.com/support/docs/local-testing-macos/)
57 | * [Documentation For Linux User](https://www.lambdatest.com/support/docs/local-testing-linux/)
58 |
59 | > Download the binary file of:
60 | * [LambdaTest tunnel for Windows](https://downloads.lambdatest.com/tunnel/v3/windows/64bit/LT_Windows.zip)
61 | * [LambdaTest tunnel for Mac](https://downloads.lambdatest.com/tunnel/v3/mac/64bit/LT_Mac.zip)
62 | * [LambdaTest tunnel for Linux](https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip)
63 |
64 | ## Getting Started
65 |
66 | Running WebDriverIO 5.6.2 test scripts on LambdaTest [Selenium Grid](https://www.lambdatest.com/blog/why-selenium-grid-is-ideal-for-automated-browser-testing/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium) is as easy as changing a few lines of code. To start with, you would have to invoke Selenium remote webdriver instead of local browser webdriver. In addition, since we are using remote webdriver, we have to define which browser environment we want to run the test. We do that by passing browser environment details to LambdaTest Selenium Grid via desired capabilities class. You can use [LambdaTest Capabilities Generator](https://www.lambdatest.com/capabilities-generator/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium) to select & pass those browser environment specifications.
67 |
68 | Let’s check out sample WebDriverIO 5.6.2 framework code running LambdaTest Selenium Grid. This is a simple WebDriverIO 5.6.2 automation script that test a sample to-do list app. The code marks two list items as done, adds a list item and then finally gives the total number of pending items as output.
69 |
70 | You can also find this code at our [GitHub repository for WebDriverIO](https://github.com/LambdaTest/webdriverio-selenium) 5.6.2.
71 | ``` js
72 | var assert = require('assert');
73 |
74 | describe('Lambdatest Demo Test', function() {
75 | it('Lambdatest Demo TestCase', function () {
76 | browser
77 | .url('https://lambdatest.github.io/sample-todo-app/')
78 | .click('*[name="li1"]')
79 | .click('*[name="li2"]')
80 | .setValue('*[id="sampletodotext"]','Lambdatest\n');
81 |
82 | assert(browser.getTitle().match(/Sample page - lambdatest.com/i));
83 | });
84 | });
85 | ```
86 |
87 | Below is the config.js file where we will be declaring the desired capabilities.
88 |
89 | ``` js
90 | user= process.env.LT_USERNAME || "",
91 | key= process.env.LT_ACCESS_KEY || "",
92 |
93 | exports.config = {
94 |
95 | updateJob: false,
96 | user,
97 | key,
98 | specs: [
99 | './tests/specs/single_test.js'
100 | ],
101 | exclude: [],
102 |
103 | capabilities: [{
104 | browserName: 'chrome',
105 | version:"64.0",
106 | name:"Test webdriverio",
107 | build:"build 1",
108 | }],
109 | sync: true,
110 | logLevel: 'info',
111 | coloredLogs: true,
112 | screenshotPath: './errorShots/',
113 | baseUrl: '',
114 | waitforTimeout: 100000,
115 | connectionRetryTimeout: 90000,
116 | connectionRetryCount: 1,
117 | path: '/wd/hub',
118 | hostname: 'hub.lambdatest.com',
119 | port: 80,
120 |
121 | framework: 'mocha',
122 | mochaOpts: {
123 | ui: 'bdd'
124 | }
125 | }
126 | ```
127 |
128 | The Selenium WebDriver test would open a URL, mark the first two items in the list as done, add an item in the list, and return the total number of pending item. Your results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on [LambdaTest dashboard](https://accounts.lambdatest.com/dashboard/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium). LambdaTest dashboard will help you view all your text logs, screenshots and video recording for your entire Selenium tests.
129 |
130 | ## Execute The Test
131 |
132 | You would need to execute the below command in your terminal/cmd.
133 |
134 | `npm run single`
135 |
136 | ## Tutorials 📙
137 |
138 | Check out our latest tutorials on TestNG automation testing 👇
139 |
140 | * [How To Generate HTML Reports With WebdriverIO?](https://www.lambdatest.com/blog/webdriverio-html-reporter/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
141 | * [How To Use Deep Selectors In Selenium WebdriverIO](https://www.lambdatest.com/blog/deep-selectors-in-selenium-webdriverio/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
142 | * [Cross Browser Testing With WebDriverIO [Tutorial]](https://www.lambdatest.com/blog/webdriverio-tutorial-with-examples-for-cross-browser-testing/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
143 | * [How To Speed Up JavaScript Testing With Selenium and WebDriverIO?](https://www.lambdatest.com/blog/speed-up-javascript-testing-with-selenium-and-webdriverio/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
144 | * [WebDriverIO Tutorial: Handling Alerts & Overlay In Selenium](https://www.lambdatest.com/blog/webdriverio-tutorial-handling-alerts-overlay-in-selenium/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
145 | * [WebdriverIO Tutorial: Run Your First Automation Script](https://www.lambdatest.com/blog/webdriverio-tutorial-run-your-first-automation-script/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
146 | * [WebDriverIO Tutorial For Handling Dropdown In Selenium](https://www.lambdatest.com/blog/webdriverio-tutorial-for-handling-dropdown-in-selenium/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
147 | * [WebdriverIO Tutorial: Browser Commands for Selenium Testing](https://www.lambdatest.com/blog/webdriverio-tutorial-browser-commands-for-selenium-testing/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
148 | * [Automated Monkey Testing with Selenium & WebDriverIO (Examples)](https://www.lambdatest.com/blog/monkey-testing-with-webdriverio/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
149 | * [Selenium WebdriverIO Tutorial](https://www.lambdatest.com/blog/webdriverio-tutorial-with-examples-for-selenium-testing/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
150 | * [How To Use Strings In JavaScript With Selenium WebDriver?](https://www.lambdatest.com/blog/using-strings-in-javascript-using-selenium-webdriver/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
151 |
152 | ## Documentation & Resources :books:
153 |
154 | Visit the following links to learn more about LambdaTest's features, setup and tutorials around test automation, mobile app testing, responsive testing, and manual testing.
155 |
156 | * [LambdaTest Documentation](https://www.lambdatest.com/support/docs/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
157 | * [LambdaTest Blog](https://www.lambdatest.com/blog/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
158 | * [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
159 |
160 | ## LambdaTest Community :busts_in_silhouette:
161 |
162 | The [LambdaTest Community](https://community.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe 🌎
163 |
164 | ## What's New At LambdaTest ❓
165 |
166 | To stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/)
167 |
168 | ## About LambdaTest
169 |
170 | [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium) is a leading AI-powered test orchestration and execution platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.
171 |
172 | ### Features
173 |
174 | * Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments.
175 | * Real-time cross browser testing on 3000+ environments.
176 | * Test on Real device cloud
177 | * Blazing fast test automation with HyperExecute
178 | * Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale.
179 | * Smart Visual Regression Testing on cloud
180 | * 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more.
181 | * Automated Screenshot testing across multiple browsers in a single click.
182 | * Local testing of web and mobile apps.
183 | * Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.
184 | * Geolocation testing of web and mobile apps across 53+ countries.
185 | * LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports
186 |
187 |
188 | [
](https://accounts.lambdatest.com/register)
189 |
190 | ## We are here to help you :headphones:
191 |
192 | * Got a query? we are available 24x7 to help. [Contact Us](support@lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
193 | * For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=webdriverio-selenium)
194 |
--------------------------------------------------------------------------------
/conf/local.conf.js:
--------------------------------------------------------------------------------
1 | exports.config = {
2 | user: process.env.LT_USERNAME || "YOUR LAMBDATEST USERNAME",
3 | key: process.env.LT_ACCESS_KEY || "YOUR LAMBDATEST ACCESS KEY",
4 |
5 | updateJob: false,
6 | specs: ["../tests/specs/local_test.js"],
7 | exclude: [],
8 |
9 | capabilities: [
10 | {
11 | browserName: "chrome",
12 | version: "65.0",
13 | platform: "WIN10",
14 | name: "webdriverIO-local_test",
15 | build: "webdriverIO-lambdatest",
16 | visual: true,
17 | video: true,
18 | console: true,
19 | network: true,
20 | accessibility : true, // Enable accessibility testing
21 | accessibility.wcagVersion: 'wcag21a', // Specify WCAG version (e.g., WCAG 2.1 Level A)
22 | accessibility.bestPractice: false, // Exclude best practice issues from results
23 | accessibility.needsReview: true // Include issues that need review
24 |
25 | },
26 | ],
27 |
28 | logLevel: "info",
29 | coloredLogs: true,
30 | screenshotPath: "./errorShots/",
31 | baseUrl: "",
32 | waitforTimeout: 10000,
33 | connectionRetryTimeout: 90000,
34 | connectionRetryCount: 3,
35 | path: "/wd/hub",
36 | hostname: "hub.lambdatest.com",
37 | port: 80,
38 |
39 | framework: "mocha",
40 | mochaOpts: {
41 | ui: "bdd",
42 | timeout: 20000,
43 | },
44 | };
45 |
--------------------------------------------------------------------------------
/conf/multiple.conf.js:
--------------------------------------------------------------------------------
1 | exports.config = {
2 | user: process.env.LT_USERNAME || "YOUR LAMBDATEST USERNAME",
3 | key: process.env.LT_ACCESS_KEY || "YOUR LAMBDATEST ACCESS KEY",
4 |
5 | updateJob: false,
6 | specs: ["../tests/specs/multiple_test.js"],
7 | exclude: [],
8 |
9 | capabilities: [
10 | {
11 | browserName: "chrome",
12 | version: "latest",
13 | platform: "WIN10",
14 | name: "webdriverIO-Multiple_test",
15 | build: "webdriverIO-lambdatest",
16 | visual: false,
17 | video: true,
18 | console: false,
19 | network: false,
20 | accessibility : false, // Enable accessibility testing
21 | accessibility.wcagVersion: 'wcag21a', // Specify WCAG version (e.g., WCAG 2.1 Level A)
22 | accessibility.bestPractice: false, // Exclude best practice issues from results
23 | accessibility.needsReview: false // Include issues that need review
24 | },
25 | ],
26 |
27 | logLevel: "info",
28 | coloredLogs: true,
29 | screenshotPath: "./errorShots/",
30 | baseUrl: "",
31 | waitforTimeout: 10000,
32 | connectionRetryTimeout: 90000,
33 | connectionRetryCount: 3,
34 | path: "/wd/hub",
35 | hostname: "hub.lambdatest.com",
36 | port: 80,
37 |
38 | framework: "mocha",
39 | mochaOpts: {
40 | ui: "bdd",
41 | timeout: 20000,
42 | },
43 | };
44 |
--------------------------------------------------------------------------------
/conf/parallel.conf.js:
--------------------------------------------------------------------------------
1 | exports.config = {
2 | user: process.env.LT_USERNAME || "YOUR LAMBDATEST USERNAME",
3 | key: process.env.LT_ACCESS_KEY || "YOUR LAMBDATEST ACCESS KEY",
4 |
5 | updateJob: false,
6 | specs: ["../tests/specs/single_test.js"],
7 | exclude: [],
8 |
9 | maxInstances: 10,
10 | commonCapabilities: {
11 | name: "webdriverIO-parallel_test",
12 | build: "webdriverIO-lambdatest",
13 | visual: false,
14 | video: true,
15 | console: false,
16 | network: false,
17 | accessibility : false, // Enable accessibility testing
18 | accessibility.wcagVersion: 'wcag21a', // Specify WCAG version (e.g., WCAG 2.1 Level A)
19 | accessibility.bestPractice: false, // Exclude best practice issues from results
20 | accessibility.needsReview: false // Include issues that need review
21 | },
22 |
23 | capabilities: [
24 | {
25 | browserName: "chrome",
26 | version: "latest",
27 | platform: "WIN10",
28 | },
29 | {
30 | browser: "firefox",
31 | version: "latest",
32 | platform: "WIN7",
33 | },
34 | {
35 | browser: "internet explorer",
36 | version: "latest",
37 | platform: "WIN10",
38 | },
39 | {
40 | browser: "MicrosoftEdge",
41 | version: "latest",
42 | platform: "WIN10",
43 | },
44 | ],
45 |
46 | logLevel: "info",
47 | coloredLogs: true,
48 | screenshotPath: "./errorShots/",
49 | baseUrl: "",
50 | waitforTimeout: 10000,
51 | connectionRetryTimeout: 90000,
52 | connectionRetryCount: 3,
53 | path: "/wd/hub",
54 | hostname: "hub.lambdatest.com",
55 | port: 80,
56 |
57 | framework: "mocha",
58 | mochaOpts: {
59 | ui: "bdd",
60 | timeout: 20000,
61 | },
62 | };
63 |
64 | // Code to support common capabilities
65 | exports.config.capabilities.forEach(function (caps) {
66 | for (var i in exports.config.commonCapabilities)
67 | caps[i] = caps[i] || exports.config.commonCapabilities[i];
68 | });
69 |
--------------------------------------------------------------------------------
/conf/single.conf.js:
--------------------------------------------------------------------------------
1 | exports.config = {
2 | user: process.env.LT_USERNAME || "YOUR LAMBDATEST USERNAME",
3 | key: process.env.LT_ACCESS_KEY || "YOUR LAMBDATEST ACCESS KEY",
4 |
5 | updateJob: false,
6 | specs: ["../tests/specs/single_test.js"],
7 | exclude: [],
8 |
9 | capabilities: [
10 | {
11 | browserName: "chrome",
12 | version: "latest",
13 | platform: "WIN10",
14 | name: "webdriverIO-single_test",
15 | build: "webdriverIO-lambdatest",
16 | visual: false,
17 | video: true,
18 | console: false,
19 | network: false,
20 | accessibility : false, // Enable accessibility testing
21 | accessibility.wcagVersion: 'wcag21a', // Specify WCAG version (e.g., WCAG 2.1 Level A)
22 | accessibility.bestPractice: false, // Exclude best practice issues from results
23 | accessibility.needsReview: false // Include issues that need review
24 |
25 | },
26 | ],
27 |
28 | logLevel: "info",
29 | coloredLogs: true,
30 | screenshotPath: "./errorShots/",
31 | baseUrl: "",
32 | waitforTimeout: 10000,
33 | connectionRetryTimeout: 90000,
34 | connectionRetryCount: 3,
35 | path: "/wd/hub",
36 | hostname: "hub.lambdatest.com",
37 | port: 80,
38 |
39 | framework: "mocha",
40 | mochaOpts: {
41 | ui: "bdd",
42 | timeout: 20000,
43 | },
44 | };
45 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webdriverio-Lambdatest",
3 | "version": "0.1.0",
4 | "readme": "WendriverIO Integration with [Lambdatest](https://www.Lambdatest.com)",
5 | "description": "Selenium examples for WebdriverIO and Lambdatest Automate",
6 | "scripts": {
7 | "test": "npm run single && npm run local && npm run parallel",
8 | "single": "./node_modules/.bin/wdio conf/single.conf.js",
9 | "parallel": "./node_modules/.bin/wdio conf/parallel.conf.js",
10 | "local": "./node_modules/.bin/wdio conf/local.conf.js",
11 | "multiple": "./node_modules/.bin/wdio conf/multiple.conf.js"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/Lambdatest/webdriverio-Lambdatest.git"
16 | },
17 | "keywords": [
18 | "webdriverio",
19 | "Lambdatest",
20 | "selenium",
21 | "tests"
22 | ],
23 | "bugs": {},
24 | "homepage": "https://github.com/Lambdatest/webdriverio-Lambdatest#readme",
25 | "dependencies": {
26 | "@wdio/cli": "^8.27.1",
27 | "@wdio/local-runner": "^8.27.0",
28 | "@wdio/mocha-framework": "^8.27.0"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/tests/specs/local_test.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | describe('Lambdatest Local Testing', function() {
4 | it('can check tunnel working', async function () {
5 | await browser.url('http://localhost.lambdatest.com/todo.html')
6 | const firstElement = await browser.$('*[name="li1"]');
7 | await firstElement.click();
8 | const secondElement = await browser.$('*[name="li2"]');
9 | await secondElement.click();
10 | const input = await browser.$('*[id="sampletodotext"]');
11 | await input.setValue('Lambdatest\n');
12 | const title = await browser.getTitle();
13 | assert(title.match(/Sample page - lambdatest.com/i));
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/tests/specs/multiple/test_01.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | describe('Lambdatest Demo Test', function() {
4 | it('Lambdatest Demo Testcase', async function () {
5 | await browser.url('https://lambdatest.github.io/sample-todo-app/')
6 | const firstElement = await browser.$('*[name="li1"]');
7 | await firstElement.click();
8 | const input = await browser.$('*[id="sampletodotext"]');
9 | await input.setValue('Lambdatest\n');
10 | const title = await browser.getTitle();
11 | assert(title.match(/Sample page - lambdatest.com/i));
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/tests/specs/multiple/test_02.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | describe('Lambdatest Demo Test', function() {
4 | it('Lambdatest Demo Testcase', async function () {
5 | await browser.url('https://lambdatest.github.io/sample-todo-app/')
6 | const firstElement = await browser.$('*[name="li2"]');
7 | await firstElement.click();
8 | const input = await browser.$('*[id="sampletodotext"]');
9 | await input.setValue('Lambdatest\n');
10 | const title = await browser.getTitle();
11 | assert(title.match(/Sample page - lambdatest.com/i));
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/tests/specs/multiple/test_03.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | describe('Lambdatest Demo Test', function() {
4 | it('Lambdatest Demo Testcase', async function () {
5 | await browser.url('https://lambdatest.github.io/sample-todo-app/')
6 | const input = await browser.$('*[id="sampletodotext"]');
7 | await input.setValue('Lambdatest\n');
8 | const title = await browser.getTitle();
9 | assert(title.match(/Sample page - lambdatest.com/i));
10 | });
11 | });
12 |
--------------------------------------------------------------------------------
/tests/specs/multiple_test.js:
--------------------------------------------------------------------------------
1 | var specs = [
2 | './multiple/test_01.js',
3 | './multiple/test_02.js',
4 | './multiple/test_03.js'
5 | ];
6 |
7 | for (var i = specs.length - 1; i >= 0; i--) {
8 | require(specs[i]);
9 | };
10 |
--------------------------------------------------------------------------------
/tests/specs/single_test.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 |
3 | describe('Lambdatest Demo Test', function() {
4 | it('Lambdatest Demo TestCase', async function () {
5 | await browser.url('https://lambdatest.github.io/sample-todo-app/')
6 | const firstElement = await browser.$('*[name="li1"]');
7 | await firstElement.click();
8 | const secondElement = await browser.$('*[name="li2"]');
9 | await secondElement.click();
10 | const input = await browser.$('*[id="sampletodotext"]');
11 | await input.setValue('Lambdatest\n');
12 | const title = await browser.getTitle();
13 | assert(title.match(/Sample page - lambdatest.com/i));
14 | });
15 | });
16 |
--------------------------------------------------------------------------------