@lambdatest/cypress-driver 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/smartui.js +4 -5
- package/types/index.d.ts +14 -0
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambdatest/cypress-driver",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Cypress driver for all Lambdatest functionalities",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/LambdaTest/lambdatest-js-sdk.git",
|
package/src/smartui.js
CHANGED
|
@@ -14,12 +14,11 @@ function smartuiSnapshot(name, options = {}) {
|
|
|
14
14
|
snapshot: name,
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
if (!(await client.isSmartUIRunning())) {
|
|
19
|
-
throw new Error('Cannot find SmartUI server.');
|
|
20
|
-
}
|
|
21
17
|
|
|
22
|
-
let resp = await client.
|
|
18
|
+
let resp = await client.isSmartUIRunning()
|
|
19
|
+
if (!resp.body.cliVersion) throw new Error(`cannot find SmartUI server; ${JSON.stringify(resp)}`);
|
|
20
|
+
|
|
21
|
+
resp = await client.fetchDOMSerializer();
|
|
23
22
|
eval(resp.body.data.dom);
|
|
24
23
|
|
|
25
24
|
return cy.document({ log: false }).then({ timeout: CY_TIMEOUT }, dom => {
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Cypress {
|
|
5
|
+
interface Chainable<Subject = any> {
|
|
6
|
+
/**
|
|
7
|
+
* Captures a SmartUI snapshot.
|
|
8
|
+
* @param name The name of the snapshot.
|
|
9
|
+
* @param options Additional options for snapshot capture.
|
|
10
|
+
*/
|
|
11
|
+
smartuiSnapshot(name?: string, options?: object): Chainable<Subject>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|