Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
517275d
Merge pull request #16 from LambdaTest/stage
sushobhit-lt Jan 4, 2024
dc820d2
Update README.md
haiderLambdatest Feb 29, 2024
1db15b4
Update README.md - 4
haiderLambdatest Mar 18, 2024
f6975a3
Update README.md-7
haiderLambdatest Mar 18, 2024
550b0c0
Update README.md-8
haiderLambdatest Mar 18, 2024
13c841f
Update README.md-1-PROD
haiderLambdatest Mar 18, 2024
fea01ff
Update README.md-pr1
haiderLambdatest Mar 18, 2024
fd8c79d
nbc 25-04-24
haiderLambdatest Apr 25, 2024
7a8149c
nbc2 25-04-24
haiderLambdatest Apr 25, 2024
4773ea8
Merge pull request #3 from haiderLambdatest/haiderlt
haiderLambdatest Apr 25, 2024
a8d999c
Github PR check
haiderLambdatest Jun 20, 2024
6efb530
EgifterCheck-1
haiderLambdatest Jul 18, 2024
e65ce04
EgifterCheck-2
haiderLambdatest Jul 18, 2024
e381ace
EgifterCheck-3
haiderLambdatest Jul 18, 2024
539744e
EgifterCheck-4
haiderLambdatest Jul 18, 2024
e80348a
EgifterCheck-5
haiderLambdatest Jul 18, 2024
17c028a
EgifterCheck-6
haiderLambdatest Jul 18, 2024
a86c1e5
EgifterCheck-7
haiderLambdatest Jul 18, 2024
e3329f5
EgifterCheck-8
haiderLambdatest Jul 18, 2024
0e3cf44
EgifterCheck-9
haiderLambdatest Jul 18, 2024
880d13a
EgifterCheck-10
haiderLambdatest Jul 18, 2024
caf212d
EgifterCheck-11
haiderLambdatest Jul 18, 2024
64eabfe
EgifterCheck-12
haiderLambdatest Jul 18, 2024
63401eb
EgifterCheck-13
haiderLambdatest Jul 18, 2024
dcea9c1
EgifterCheck-14
haiderLambdatest Jul 18, 2024
48c04bf
EgifterCheck-15
haiderLambdatest Jul 18, 2024
3861cc1
EgifterCheck-16
haiderLambdatest Jul 18, 2024
362df30
EgifterCheck-17
haiderLambdatest Jul 18, 2024
006993d
EgifterCheck-18
haiderLambdatest Jul 18, 2024
5d31285
EgifterCheck-17
haiderLambdatest Jul 18, 2024
0f88c70
EgifterCheck-18
haiderLambdatest Jul 18, 2024
1eb93b7
EgifterCheck-19
haiderLambdatest Jul 18, 2024
b90198b
EgifterCheck-20
haiderLambdatest Jul 18, 2024
4cb04c2
EgifterCheck-21
haiderLambdatest Jul 18, 2024
3761ee2
EgifterCheck-22
haiderLambdatest Jul 19, 2024
fbddf26
EgifterCheck-23
haiderLambdatest Jul 19, 2024
2f7fac7
EgifterCheck-24
haiderLambdatest Jul 19, 2024
a1ded71
EgifterCheck-25
haiderLambdatest Jul 19, 2024
f9f3231
EgifterCheck-26
haiderLambdatest Jul 19, 2024
c879286
GethealthieCheck-1
haiderLambdatest Jul 19, 2024
f7ec1af
GethealthieCheck-2
haiderLambdatest Jul 19, 2024
8b713fa
GethealthieCheck-3
haiderLambdatest Jul 19, 2024
cc566d2
GethealthieCheck-4
haiderLambdatest Jul 19, 2024
f892581
GethealthieCheck-5
haiderLambdatest Jul 19, 2024
6d40406
Gethealthie-1
haiderLambdatest Jul 22, 2024
fb4e259
Gethealthie-2
haiderLambdatest Jul 22, 2024
19dfc21
Gethealthie-3
haiderLambdatest Jul 22, 2024
25b1e1e
Gethealthie-4
haiderLambdatest Jul 22, 2024
7b8baca
Gethealthie-5
haiderLambdatest Jul 22, 2024
e0dba76
Gethealthie-6
haiderLambdatest Jul 22, 2024
d136d02
Gethealthie-7
haiderLambdatest Jul 22, 2024
765e8ec
Gethealthie-8
haiderLambdatest Jul 22, 2024
d3f54dc
Gethealthie-9
haiderLambdatest Jul 22, 2024
3c89267
Gethealthie-10
haiderLambdatest Jul 22, 2024
180fd96
Gethealthie-11
haiderLambdatest Jul 22, 2024
31db7d3
Gethealthie-12
haiderLambdatest Jul 22, 2024
30c9b2e
Gethealthie-13
haiderLambdatest Jul 22, 2024
786480a
Web-1
haiderLambdatest Jul 22, 2024
453d582
Web-2
haiderLambdatest Jul 22, 2024
7d67b54
Web-3
haiderLambdatest Jul 22, 2024
b6c93e7
Web-4
haiderLambdatest Jul 22, 2024
5ee4858
Web-5
haiderLambdatest Jul 22, 2024
bcdcc4b
Web-6
haiderLambdatest Jul 22, 2024
587799f
Web-6
haiderLambdatest Jul 22, 2024
2dabfb7
Web-7
haiderLambdatest Jul 22, 2024
9a3be77
Web-8
haiderLambdatest Jul 22, 2024
6703bbb
Web-9
haiderLambdatest Jul 22, 2024
2354663
Web-10
haiderLambdatest Jul 22, 2024
b7b21ca
Web-12
haiderLambdatest Jul 22, 2024
90a94d1
Web-13
haiderLambdatest Jul 22, 2024
dfa6bc8
Web-14
haiderLambdatest Jul 22, 2024
047141a
Web-15
haiderLambdatest Jul 22, 2024
c1cea9c
Web-16
haiderLambdatest Jul 22, 2024
7d0fe36
Web-17
haiderLambdatest Jul 22, 2024
61be5c7
Web-18
haiderLambdatest Jul 23, 2024
e3745a6
Web-19
haiderLambdatest Jul 23, 2024
b05cadb
Web-20
haiderLambdatest Jul 23, 2024
e074914
Web-21
haiderLambdatest Jul 23, 2024
21a24ad
Web-22
haiderLambdatest Jul 23, 2024
c72363d
Web-23
haiderLambdatest Jul 23, 2024
7046287
Web-24
haiderLambdatest Jul 23, 2024
e957970
Web-25
haiderLambdatest Jul 23, 2024
d4f60a8
Web-26
haiderLambdatest Jul 23, 2024
32e2658
Web-27
haiderLambdatest Jul 23, 2024
a5225de
Web-28
haiderLambdatest Jul 23, 2024
96c6d43
Web-29
haiderLambdatest Jul 23, 2024
54ed948
Web-30
haiderLambdatest Jul 23, 2024
26d0d3e
Web-31
haiderLambdatest Jul 23, 2024
c234a35
Web-32
haiderLambdatest Jul 23, 2024
52accc8
Web-33
haiderLambdatest Jul 23, 2024
7f18695
Web-34
haiderLambdatest Jul 23, 2024
5b0761b
Web-35
haiderLambdatest Jul 23, 2024
a401d5e
Web-36
haiderLambdatest Jul 23, 2024
5e6bb4a
Web-37
haiderLambdatest Jul 23, 2024
3dbf04c
Web-38
haiderLambdatest Jul 23, 2024
e110498
Web-39
haiderLambdatest Jul 23, 2024
18b855f
Web-40
haiderLambdatest Jul 23, 2024
0ab0a74
Web-41
haiderLambdatest Jul 23, 2024
1f61958
Web-42
haiderLambdatest Jul 23, 2024
0e56fdc
Web-43
haiderLambdatest Jul 23, 2024
47e0a0b
Web-44
haiderLambdatest Jul 23, 2024
58b1389
Web-45
haiderLambdatest Jul 23, 2024
52b0517
Web-46
haiderLambdatest Jul 23, 2024
5fa0140
Web-47
haiderLambdatest Jul 23, 2024
2286830
Web-48
haiderLambdatest Jul 23, 2024
a87f5f0
Web-49
haiderLambdatest Jul 23, 2024
27bab8d
Web-50
haiderLambdatest Jul 23, 2024
dbc5aee
Web-51
haiderLambdatest Jul 23, 2024
bb3f09d
DOT-3533-1
haiderLambdatest Jul 23, 2024
c8c3461
DOT-3533-2
haiderLambdatest Jul 23, 2024
a13be8f
DOT-3533-3
haiderLambdatest Jul 23, 2024
f32dd52
DOT-3533-4
haiderLambdatest Jul 23, 2024
4b28ece
DOT-3533-5
haiderLambdatest Jul 23, 2024
8092743
DOT-3533-6
haiderLambdatest Jul 23, 2024
9c72f0a
DOT-3533-7
haiderLambdatest Jul 23, 2024
a5a9703
DOT-3533-8
haiderLambdatest Jul 23, 2024
eebdfa3
DOT-3533-9
haiderLambdatest Jul 23, 2024
6d0ae49
DOT-3533-9
haiderLambdatest Jul 23, 2024
ea0f6b1
DOT-3533-11
haiderLambdatest Jul 23, 2024
563c052
DOT-3533-12
haiderLambdatest Jul 23, 2024
f9b42ed
07-08-24 | Commit-1
haiderLambdatest Aug 6, 2024
c075ca8
07-08-24 | Commit-2
haiderLambdatest Aug 6, 2024
7a35e9b
07-08-24 | Commit-3
haiderLambdatest Aug 6, 2024
bd2a94f
07-08-24 | Commit-4
haiderLambdatest Aug 6, 2024
8680281
07-08-24 | Commit-5
haiderLambdatest Aug 6, 2024
ee9c889
07-08-24 | Commit-6
haiderLambdatest Aug 6, 2024
285e52c
07-08-24 | Commit-7
haiderLambdatest Aug 6, 2024
8979dc3
07-08-24 | Commit-8
haiderLambdatest Aug 6, 2024
86b7995
07-08-24 | Commit-9
haiderLambdatest Aug 6, 2024
4872db1
07-08-24 | Commit-10
haiderLambdatest Aug 6, 2024
3ab47d9
07-08-24 | Commit-11
haiderLambdatest Aug 7, 2024
95827bf
07-08-24 | Commit-12
haiderLambdatest Aug 7, 2024
72dbea1
07-08-24 | Commit-13
haiderLambdatest Aug 7, 2024
9f21705
07-08-24 | Commit-14
haiderLambdatest Aug 7, 2024
aa0257f
07-08-24 | Commit-15
haiderLambdatest Aug 7, 2024
126ef5d
07-08-24 | Commit-16
haiderLambdatest Aug 7, 2024
1a91a2a
07-08-24 | Commit-17
haiderLambdatest Aug 7, 2024
1301bc8
07-08-24 | Commit-18
haiderLambdatest Aug 7, 2024
a1be1e7
07-08-24 | Commit-19
haiderLambdatest Aug 7, 2024
6dd20bf
07-08-24 | Commit-20
haiderLambdatest Aug 7, 2024
0b88b21
07-08-24 | Commit-21
haiderLambdatest Aug 7, 2024
c2da4ea
07-08-24 | Commit-22
haiderLambdatest Aug 7, 2024
d4119f3
07-08-24 | Commit-23
haiderLambdatest Aug 7, 2024
aaf80e0
07-08-24 | Commit-24
haiderLambdatest Aug 7, 2024
5a3b7e0
07-08-24 | Commit-25
haiderLambdatest Aug 7, 2024
65fd67b
07-08-24 | Commit-26
haiderLambdatest Aug 7, 2024
5c5eafa
07-08-24 | Commit-27
haiderLambdatest Aug 7, 2024
a853165
07-08-24 | Commit-28
haiderLambdatest Aug 7, 2024
f1c3090
prod | 07-08-24 | Commit-1
haiderLambdatest Aug 7, 2024
35bb363
prod | 07-08-24 | Commit-2
haiderLambdatest Aug 7, 2024
092f276
prod | 07-08-24 | Commit-3
haiderLambdatest Aug 7, 2024
7dd71f7
prod | 07-08-24 | Commit-4
haiderLambdatest Aug 7, 2024
bc250d9
grdp pr check 31-Aug
haiderLambdatest Aug 31, 2024
1e18bc4
grdp pr check 31-Aug-1
haiderLambdatest Aug 31, 2024
fe0dd0e
grdp pr check 31-Aug-2
haiderLambdatest Aug 31, 2024
ddd67f9
grdp pr check 03-09-24
haiderLambdatest Sep 3, 2024
62ac303
grdp pr check 04-09-24
haiderLambdatest Sep 4, 2024
2a30ce3
grdp pr check-stage 05-09-24
haiderLambdatest Sep 4, 2024
ebb75b3
grdp pr check-stage 05-09-24_1
haiderLambdatest Sep 4, 2024
ecfe21a
grdp pr check-stage 05-09-24_2
haiderLambdatest Sep 4, 2024
bfe10b1
5-9-24 prod-euGdpr
haiderLambdatest Sep 5, 2024
2dd1c25
9-9-24-1
haiderLambdatest Sep 9, 2024
0959e03
comparisonStratgy
haiderLambdatest Dec 5, 2024
f761cb2
comparisonStratgy1
haiderLambdatest Dec 6, 2024
1582885
comparisonStratgy2
haiderLambdatest Dec 6, 2024
dd142f6
comparisonStratgy3
haiderLambdatest Dec 6, 2024
c6fe813
comparisonStratgy4
haiderLambdatest Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<h1>Smart UI Testing With GitHub</h1>
---
runme:
id: 01HWAFWEYMX18NF1CSHAZ7M8QB
version: v3
---

<h1>Smart UI Testing With GitHub</h1>

<img height="400" src="https://user-images.githubusercontent.com/126776938/232716259-60606fe2-d9ed-4449-9586-321a5950308e.png">


<p align="center">

<a href="https://www.lambdatest.com/blog/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample" target="_bank">Blog</a>
&nbsp; &#8901; &nbsp;
<a href="https://www.lambdatest.com/support/docs/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample" target="_bank">Docs</a>
Expand All @@ -17,19 +25,20 @@
</p>
&emsp;
&emsp;

&emsp;

*Learn the how to get started with testing GitHub app integration with SmartUI on the LambdaTest platform.*

[<img height="58" width="200" src="https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png">](https://accounts.lambdatest.com/register?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)
*Learn the how to get started with testing GitHub app integration with SmartUI on the LambdaTest platform.*

[](https://accounts.lambdatest.com/register?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)

## Table of Contents:


* [Pre-requisites](#pre-requisites)
* [Getting Started With Github App Integration with SmartUI](#getting-started-with-github-app-integration-with-smartui)


## Pre-requisites

* An account with Github with valid permission to install new applications to your repositories.
Expand All @@ -38,24 +47,23 @@

## Getting Started With Github App Integration with SmartUI

### Steps 1: Integrate the your Lambdatest Account with GitHub App.
### Steps 1: Integrate the your Lambdatest Account with GitHub App.

You can integrate your LambdaTest account with the GiHub application in the following ways:

- Using OAuth

![github-app-landing-92ef6e152a7302cb9ab88f5034b9ec0c](https://user-images.githubusercontent.com/126776938/232715867-f375b4df-1bc9-4e88-8340-44e986be2e9a.png)


### Step 2: Select your GitHub repository
### Step 2: Select your GitHub repository

Go to your GitHub repository where you want to configure your SmartUI project. Check out our GitHub sample [here](https://github.com/LambdaTest/smartui-node-sample).

### Step 3: Configure your test suite

Add the `Github` capability to your current test configuration:

```bash
```bash {"id":"01HWAFWEYGEXVSMJCB2CKFCSDN"}
const capabilities: {
platform: "Windows 10",
browserName: "chrome",
Expand All @@ -76,12 +84,14 @@ Setting up your CI workflow to execute on GitHub. Here is an example setup with

Go to `.github/workflows/<your_ci_file>.yml`.

```bash
```bash {"id":"01HWAFWEYHTNW1BFEH1B42Q0EE"}
name: Execute SmartUI Test with Github App Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1



- name: Create commit status
run: |
API_HOST=https://api.github.com
Expand All @@ -100,31 +110,31 @@ Go to `.github/workflows/<your_ci_file>.yml`.

After the setup is completed, you can now execute your test suite with the Continuos Integration (CI) pipeline with any tool of your choice.

**Please Note:** *On running the tests with this repository the user should be able to trigger the `GitHub Action` and execute the `SmartUI` tests for `Selenium`, `Cypress, CDP, and Taiko` frameworks. As this action does not work for `StoryBook`, check our how you can SmartUI test with `StoryBook` [here](https://github.com/LambdaTest/smartui-storybook).*
**Please Note:** *On running the tests with this repository the user should be able to trigger the `GitHub Action` and execute the `SmartUI` tests for `Selenium`, `Cypress, CDP, and Taiko` frameworks. As this action does not work for `StoryBook`, check our how you can SmartUI test with `StoryBook` [here](https://github.com/LambdaTest/smartui-storybook).*

### Step 6: Commit you changes over git on a branch and raise the PR to main branch.

### Step 7: Now you will see the `lambdatest-smartui-app` in the PR.

## Documentation & Resources :books:

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.

* [LambdaTest Documentation](https://www.lambdatest.com/support/docs/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)
* [LambdaTest Blog](https://www.lambdatest.com/blog/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)
* [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)
* [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)

## LambdaTest Community :busts_in_silhouette:

The [LambdaTest Community](https://community.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample) 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 🌎

## What's New At LambdaTest ❓

To stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/)
To stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/)

## About LambdaTest

[LambdaTest](https://www.lambdatest.com?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample) is an intelligent unified digital experience testing cloud that helps businesses drastically reduce time to market through faster test execution, ensuring quality releases and accelerated digital transformation. The platforms allows you to perform both real time and automation testing across 3000+ environments and real mobile devices, making it a top choice among other cloud testing platforms. Over 10,000+ enterprise customers and 2+ million users across 130+ countries rely on LambdaTest for their testing needs.
[LambdaTest](https://www.lambdatest.com?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample) is an intelligent unified digital experience testing cloud that helps businesses drastically reduce time to market through faster test execution, ensuring quality releases and accelerated digital transformation. The platforms allows you to perform both real time and automation testing across 3000+ environments and real mobile devices, making it a top choice among other cloud testing platforms. Over 10,000+ enterprise customers and 2+ million users across 130+ countries rely on LambdaTest for their testing needs.

### Features

Expand All @@ -140,11 +150,11 @@ To stay updated with the latest features and product add-ons, visit [Changelog](
* Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.
* Geolocation testing of web and mobile apps across 53+ countries.
* LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports
[<img height="58" width="200" src="https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png">](https://accounts.lambdatest.com/register?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)

[](https://accounts.lambdatest.com/register?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)

## We are here to help you :headphones:

* Got a query? we are available 24x7 to help. [Contact Us](mailto:[email protected])
* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=playwright-sample)

182 changes: 111 additions & 71 deletions tests/test.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,149 @@
const webdriver = require("selenium-webdriver");
const By = webdriver.By;
var moment = require("moment");
var waitTime = 2 // 2 seconds
const moment = require("moment");

const waitTime = 2; // 2 seconds

// username: Username can be found at automation dashboard
const USERNAME = process.env.LT_USERNAME || "username";
// const USERNAME = process.env.LT_USERNAME || "haiderk";

// AccessKey: AccessKey can be generated from automation dashboard or profile section
const KEY = process.env.LT_ACCESS_KEY || "accessKey";
// AccessKey: AccessKey can be generated from automation dashboard or profile section
// const KEY = process.env.LT_ACCESS_KEY || "i7vF5r66IYgsgE9Hp5t6hZqd5PkQX021FgpWRC70mp0ShbFh1R";

// gridUrl: gridUrl can be found at automation dashboard
const GRID_HOST =
process.env.GRID_HOST || "@hub.lambdatest.com/wd/hub"; //connect to lambdatest hub
// const GRID_HOST = process.env.GRID_HOST || "@hub.lambdatest.com/wd/hub"; //connect to lambdatest hub

// const GRID_URL = process.env.GRID_URL || "GRID_URL";
const GRID_URL = "https://haiderk:W0AB7YqcubvLeUNPD65N2XANdVq55VZO8KdmLAEO1fbrSFC97B@stage-hub.lambdatestinternal.com/wd/hub";
// const GRID_URL = "https://smartui-internal:jNbKw8iwoDlqGuBfIBtd5F1Cnr4A0H07ifYNDGpylobjWyA2QX@stage-hub.lambdatestinternal.com/wd/hub";
// const GRID_URL = "https://haiderk:i7vF5r66IYgsgE9Hp5t6hZqd5PkQX021FgpWRC70mp0ShbFh1R@hub.lambdatest.com/wd/hub";
// const GRID_URL = "https://ltgdprhak:1JF7nbtNVDTSFQdstywJQxVqaaIEX87sP7q7ghbFjwpcm5Kbgv@stage-hub-eu.lambdatestinternal.com/wd/hub";
// const GRID_URL = "https://gdpreu:svffEGGVpCulkAYtaqCRVbHIwrZor4aD0BeF89I3xbaPLTpcXz@hub-eu.lambdatest.com/wd/hub";


const GRID_URL = process.env.GRID_URL || "GRID_URL";

async function searchTextOnGoogle() {
var keys = process.argv;
const keys = process.argv;
console.log(keys);
let parallelCount = keys[2] || 1;
let tunnel = keys[3] || false;
let platform = keys[4] || "Windows 10";
let browserName = keys[5] || "chrome";
let version = keys[6] || "latest";
const parallelCount = keys[2] || 1;
const tunnel = keys[3] || false;
const platform = keys[4] || "Windows 10";
// const platform = keys[4] || "bigsur";
const browserName = keys[5] || "chrome";
const version = keys[6] || "latest";

// Setup Input capabilities
let capabilities = {
const capabilities = {
platform: platform,
browserName: browserName,
version: version,
queueTimeout: 300,
visual: true,
user: USERNAME,
accessKey: KEY,
user: process.env.LT_USERNAME,
accessKey: process.env.LT_ACCESS_KEY,
name: "test session", // name of the test
build: platform + browserName + version, // name of the build
"smartUI.project": "github-integration-demo",
build: `${platform}${browserName}${version}`, // name of the build
"smartUI.smartIgnore":true,
"smartUI.project": "[Git_Branching#ComparisonStrategy]",


github: {
url: process.env.GITHUB_URL,
},
};

};
if (tunnel === "true") {
capabilities.tunnel = true;
}

var gridUrl = GRID_URL;
console.log("gridUrl : ", gridUrl);
console.log("GITHUB_REPOSITORY : ", process.env.GITHUB_REPOSITORY);
console.log("gridUrl: ", GRID_URL);
console.log("GITHUB_REPOSITORY: ", process.env.GITHUB_REPOSITORY);

console.log(capabilities);
console.log("Running " + parallelCount + " parallel tests ");
let i = 1;
for (i = 1; i <= parallelCount; i++) {
startTest(gridUrl, capabilities, "Test " + i);
console.log(`Running ${parallelCount} parallel tests`);

for (let i = 1; i <= parallelCount; i++) {
startTest(GRID_URL, capabilities, `Test ${i}`);
}
}

searchTextOnGoogle();

async function startTest(gridUrl, capabilities, name) {
const caps = capabilities;
var start_date = moment();

const driver = await new webdriver.Builder()
.usingServer(gridUrl)
.withCapabilities(caps)
.build();

var end_date = moment();
var duration = moment.duration(end_date.diff(start_date));
console.log(caps.name, " : Setup Time :", duration.asSeconds());

// navigate to a url
let url = "https://www.lambdatest.com";
url = "https://www.lambdatest.com/enterprise";
console.log(url);
await driver
.get(url)
.then(function () {
const session = driver.getSession();

// For Smartui TakeScreenshot
setTimeout(function () {
console.log("taking screenshot ...")
driver.executeScript(`smartui.takeScreenshot,{"screenshotName":"sample-screenshot"}`).then(out => {
console.log("RESPONSE :", out)
return
const caps = { ...capabilities, name };

try {
const start_date = moment();

const driver = await new webdriver.Builder()
.usingServer(gridUrl)
.withCapabilities(caps)
.build();

const end_date = moment();
const duration = moment.duration(end_date.diff(start_date));
console.log(`${caps.name} : Setup Time: ${duration.asSeconds()} seconds`);

// const url = "https://www.lambdatest.com/";
// const url = "https://www.flipkart.com/";
const url = "https://www.samsung.com/";
console.log(url);
await driver.get(url);

console.log("taking screenshot ...");
setTimeout(() => {
driver.executeScript(`smartui.takeScreenshot=TEST`).then(() => {

driver.executeScript(`smartui.fetchScreenshotStatus=TEST`).then(out => {
console.log("response:", out);
}).catch(err => {
console.error("Error fetching screenshot status:", err);
});
}, waitTime * 1000);


driver.getTitle().then(function (title) {
setTimeout(function () {
driver.executeScript("lambda-status=passed");
}).catch(err => {
console.error("Error taking screenshot:", err);
});
}, waitTime * 1000);

driver.getTitle().then(function (title) {
console.log("Title:", title);
setTimeout(function () {
driver.executeScript("lambda-status=passed").then(() => {
driver.quit();
}, 15000);
}).catch(err => {
console.error("Error setting lambda status to passed:", err);
driver.quit();
});
}, 15000);
}).catch(err => {
console.error("Error getting title:", err);
driver.executeScript("lambda-status=failed").then(() => {
driver.quit();
}).catch(scriptError => {
console.error("Failed to set lambda status:", scriptError);
driver.quit();
});
})
.catch(function (err) {
error = JSON.stringify(err);
console.log(error);
console.log("test failed with reason " + err);
driver.executeScript("lambda-status=failed");
driver.quit();
});
} catch (err) {
console.error("Test failed with reason:", err);
try {
await driver.executeScript("lambda-status=failed");
} catch (scriptError) {
console.error("Failed to set lambda status:", scriptError);
}
await driver.quit();
}
}
searchTextOnGoogle();