@testim/testim-cli 3.229.0 → 3.232.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testim/testim-cli",
3
- "version": "3.229.0",
3
+ "version": "3.232.0",
4
4
  "description": "Command line interface for running Testing on your CI",
5
5
  "author": "Oren Rubin",
6
6
  "contributors": [{
@@ -47,8 +47,8 @@
47
47
  "multer": "1.4.4"
48
48
  },
49
49
  "dependencies": {
50
- "@applitools/eyes-sdk-core": "13.0.6",
51
- "@applitools/visual-grid-client": "15.9.0",
50
+ "@applitools/eyes-sdk-core": "13.2.0",
51
+ "@applitools/visual-grid-client": "15.11.0",
52
52
  "@testim/coralogix-logger": "1.1.27-beta.1",
53
53
  "@testim/webdriverio": "0.0.5",
54
54
  "abort-controller": "3.0.0",
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement, expectedX, expectedY, shouldScrollLeft, shouldScrollTop) {
2
+ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement, isDynamicScroll, expectedX, expectedY, shouldScrollLeft, shouldScrollTop) {
3
3
 
4
4
  function doScroll(expectedPosition, element) {
5
5
  if (!element) {
@@ -21,6 +21,11 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
21
21
  }
22
22
 
23
23
  var target = getLocatedElement(locatedElement);
24
+
25
+ if (isDynamicScroll && !target) {
26
+ return { x: parentElement.scrollWidth, y: parentElement.scrollHeight };
27
+ }
28
+
24
29
  if(!target) {
25
30
  throw new Error('could not find target element');
26
31
  }
@@ -63,8 +68,13 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
63
68
 
64
69
  var actualXString = result.actualX;
65
70
  var actualYString = result.actualY;
71
+ var actualScrollToElement = getLocatedElement(elementToScrollTo);
72
+
73
+ if (isScrollToElement && isDynamicScroll && !actualScrollToElement) {
74
+ return { success: false, expectedPosition };
75
+ }
76
+
66
77
  if (isScrollToElement) {
67
- var actualScrollToElement = getLocatedElement(elementToScrollTo);
68
78
  if (!actualScrollToElement) {
69
79
  throw new Error('could not find target to scroll to');
70
80
  }
@@ -38,7 +38,7 @@ class ScrollStepAction extends StepAction {
38
38
  return scroll.apply(null, arguments)
39
39
  `;
40
40
 
41
- return this.driver.executeJSWithArray(scrollCode, [elementToScrollOn, elementToScrollTo, !!step.isScrollToElement, expectedX, expectedY, step.shouldScrollLeft, step.shouldScrollTop])
41
+ return this.driver.executeJSWithArray(scrollCode, [elementToScrollOn, elementToScrollTo, Boolean(step.isScrollToElement), Boolean(step.isDynamicScroll), expectedX, expectedY, step.shouldScrollLeft, step.shouldScrollTop])
42
42
  .then((res) => {
43
43
  if(!res || !res.value) {
44
44
  return {
@@ -23,8 +23,6 @@ const ExtractTextStepAction = require('./extractTextStepAction');
23
23
  const TdkHybridStepAction = require('./tdkHybridStepAction');
24
24
  const PixelValidationStepAction = require('./pixelValidationStepAction');
25
25
 
26
- const SalesforceAutoLoginStepAction = require('./salesforceAutoLoginStepAction');
27
-
28
26
  const CliJsStepAction = require('./cliJsStepAction');
29
27
  const CliConditionStepAction = require('./cliConditionStepAction');
30
28
  const NodePackageStepAction = require('./nodePackageStepAction');
@@ -84,8 +82,6 @@ module.exports = function (driver, stepActionFactory, runMode) {
84
82
  'email-code-step': JsCodeStepAction,
85
83
  'cli-email-code-step': CliJsStepAction,
86
84
  'tdk-hybrid': TdkHybridStepAction,
87
-
88
- 'salesforce-autologin': SalesforceAutoLoginStepAction,
89
85
  };
90
86
 
91
87
  register(STEP_ACTION_MAPPING, stepActionFactory);
@@ -9,6 +9,24 @@ const { makeSDK } = require('@applitools/eyes-sdk-core');
9
9
  const { W3C_ELEMENT_ID } = require('../constants');
10
10
  const _ = require('lodash');
11
11
 
12
+ let packageJson;
13
+ // There is a difference in the folder structure in prod vs. dev
14
+ try {
15
+ // PRODUCTION
16
+ // eslint-disable-next-line import/no-unresolved
17
+ packageJson = require('../../package.json');
18
+ } catch (e) {
19
+ //pass
20
+ }
21
+ if (!packageJson) {
22
+ try {
23
+ // in dev, they are one level up
24
+ packageJson = require('../../../package.json');
25
+ } catch (e) {
26
+ //pass
27
+ }
28
+ }
29
+
12
30
  const LEGACY_ELEMENT_ID = 'ELEMENT';
13
31
 
14
32
  function extractElementId(element) {
@@ -217,10 +235,12 @@ class EyesSpec {
217
235
 
218
236
  class EyeSdkService {
219
237
  constructor() {
238
+ const sdkVersion = packageJson ? packageJson.dependencies['@applitools/eyes-sdk-core'] : 'N/A';
239
+
220
240
  /** @type {Core} */
221
241
  this.sdk = makeSDK({
222
242
  name: 'Testim.io',
223
- version: '4.0.0',
243
+ version: `4.0.0/eyes-sdk-core/${sdkVersion}`,
224
244
  spec: new EyesSpec(),
225
245
  VisualGridClient: require('@applitools/visual-grid-client'),
226
246
  });
@@ -79,7 +79,7 @@ class TestPlanRunner {
79
79
  throw err;
80
80
  })
81
81
  .finally(async () => {
82
- if ((tpOptions.lightweightMode && tpOptions.lightweightMode.disablePixelValidation) || !featureFlags.flags.applitoolsNewIntegration.isEnabled()) {
82
+ if ((tpOptions.lightweightMode && tpOptions.lightweightMode.disablePixelValidation)) {
83
83
  return;
84
84
  }
85
85
  // When sessionPlayer is available, use it - as it only attempts to close batches that exist.
@@ -13,6 +13,7 @@ const httpRequest = require('../commons/httpRequest');
13
13
  const { ArgError } = require('../errors');
14
14
  const servicesApi = require('../commons/testimServicesApi');
15
15
  const { getExtensionsUrl } = require('../runOptionsUtils');
16
+ const featureFlagService = require('../commons/featureFlags');
16
17
 
17
18
  const logger = require('../commons/logger').getLogger('lambdatestService');
18
19
 
@@ -215,7 +216,7 @@ class LambdatestService {
215
216
  console: true,
216
217
  queueTimeout: 300, // time a session spends in the LT queue, in seconds (apparently 300 is the minimum)
217
218
  // visual: true, // [NOTE]: activate LT screenshots feature (can slow test).
218
- // network: true, // [NOTE]: activate LT capture network logs feature (can cause network issues).
219
+ network: featureFlagService.flags.LTNetworkCapabilities.isEnabled(), // [NOTE]: activate LT capture network logs feature (can cause network issues).
219
220
  // fixedIP: '10.80.34.143', // [NOTE]: this is for debug purposes with LT team.
220
221
  };
221
222
  }
@@ -1,39 +0,0 @@
1
- const NavigationStepAction = require('./navigationStepAction');
2
- const Promise = require('bluebird');
3
-
4
- class SalesforceAutoLoginStepAction extends NavigationStepAction {
5
- async performAction() {
6
- let salesforceUrl = this.context.data.testimNavigationStepDestination || this.context.data.url;
7
- try {
8
- salesforceUrl = await this.updateBaseUrl(salesforceUrl);
9
- await this.driver.url(salesforceUrl);
10
- await Promise.delay(5000); // wait a little for the page to load (fixes screenshots and clicking on elements in username verification screen)
11
- let newUrl = await this.driver.getUrl();
12
- // Verify username screen
13
- const isUsernameVerificationNeeded = newUrl.includes(this.step.USERNAME_VERIFICATION_PATH_ID);
14
- const timeout = this.context.data.timeToPlayStep + 3000;
15
- if (isUsernameVerificationNeeded) {
16
- await this.driver.executeCodeAsync(`
17
- function ${this.step.handleUsernameVerificationAUTFunc.toString()}
18
- handleUsernameVerificationAUTFunc();
19
- var done = arguments[1];
20
- done();
21
- `, timeout);
22
- await Promise.delay(5000);
23
- newUrl = await this.driver.getUrl(); // If we managed to continue correctly we want to get the new redirected url
24
- }
25
- await Promise.delay(1500);
26
- return {
27
- success: true,
28
- newUrl,
29
- };
30
- } catch (err) {
31
- return {
32
- success: false,
33
- reason: err.message,
34
- };
35
- }
36
- }
37
- }
38
-
39
- module.exports = SalesforceAutoLoginStepAction;