codeceptjs 3.5.11 → 3.5.12-beta.2

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.
@@ -4347,6 +4347,16 @@ declare namespace CodeceptJS {
4347
4347
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4348
4348
  */
4349
4349
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4350
+ /**
4351
+ * Waits for number of tabs.
4352
+ *
4353
+ * ```js
4354
+ * I.waitForNumberOfTabs(2);
4355
+ * ```
4356
+ * @param expectedTabs - expecting the number of tabs.
4357
+ * @param sec - number of secs to wait.
4358
+ */
4359
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
4350
4360
  /**
4351
4361
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4352
4362
  *
@@ -7454,6 +7464,16 @@ declare namespace CodeceptJS {
7454
7464
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7455
7465
  */
7456
7466
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7467
+ /**
7468
+ * Waits for number of tabs.
7469
+ *
7470
+ * ```js
7471
+ * I.waitForNumberOfTabs(2);
7472
+ * ```
7473
+ * @param expectedTabs - expecting the number of tabs.
7474
+ * @param sec - number of secs to wait.
7475
+ */
7476
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
7457
7477
  /**
7458
7478
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7459
7479
  *
@@ -8667,6 +8687,13 @@ declare namespace CodeceptJS {
8667
8687
  *
8668
8688
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
8669
8689
  *
8690
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
8691
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
8692
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
8693
+ *
8694
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
8695
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
8696
+ *
8670
8697
  * <!-- configuration -->
8671
8698
  *
8672
8699
  * Example:
@@ -8688,6 +8715,28 @@ declare namespace CodeceptJS {
8688
8715
  * }
8689
8716
  * ```
8690
8717
  *
8718
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
8719
+ * For example:
8720
+ *
8721
+ * ```js
8722
+ * {
8723
+ * helpers: {
8724
+ * WebDriver : {
8725
+ * smartWait: 5000,
8726
+ * browser: "chrome",
8727
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
8728
+ * restart: false,
8729
+ * windowSize: "maximize",
8730
+ * timeouts: {
8731
+ * "script": 60000,
8732
+ * "page load": 10000
8733
+ * }
8734
+ * }
8735
+ * }
8736
+ * }
8737
+ * ```
8738
+ *
8739
+ *
8691
8740
  * Example with basic authentication
8692
8741
  * ```js
8693
8742
  * {
@@ -8728,6 +8777,25 @@ declare namespace CodeceptJS {
8728
8777
  * }
8729
8778
  * ```
8730
8779
  *
8780
+ * ### Running with devtools protocol
8781
+ *
8782
+ * ```js
8783
+ * {
8784
+ * helpers: {
8785
+ * WebDriver : {
8786
+ * url: "http://localhost",
8787
+ * browser: "chrome",
8788
+ * devtoolsProtocol: true,
8789
+ * desiredCapabilities: {
8790
+ * chromeOptions: {
8791
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
8792
+ * }
8793
+ * }
8794
+ * }
8795
+ * }
8796
+ * }
8797
+ * ```
8798
+ *
8731
8799
  * ### Internet Explorer
8732
8800
  *
8733
8801
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -10295,6 +10363,16 @@ declare namespace CodeceptJS {
10295
10363
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
10296
10364
  */
10297
10365
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
10366
+ /**
10367
+ * Waits for number of tabs.
10368
+ *
10369
+ * ```js
10370
+ * I.waitForNumberOfTabs(2);
10371
+ * ```
10372
+ * @param expectedTabs - expecting the number of tabs.
10373
+ * @param sec - number of secs to wait.
10374
+ */
10375
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
10298
10376
  /**
10299
10377
  * Switches frame or in case of null locator reverts to parent.
10300
10378
  *
@@ -10388,6 +10466,9 @@ declare namespace CodeceptJS {
10388
10466
  */
10389
10467
  grabPageScrollPosition(): Promise<PageScrollPosition>;
10390
10468
  /**
10469
+ * This method is **deprecated**.
10470
+ *
10471
+ *
10391
10472
  * Set the current geo location
10392
10473
  *
10393
10474
  *
@@ -10397,10 +10478,12 @@ declare namespace CodeceptJS {
10397
10478
  * ```
10398
10479
  * @param latitude - to set.
10399
10480
  * @param longitude - to set
10400
- * @param [altitude = null] - (optional, null by default) to set
10481
+ * @param [altitude] - (optional, null by default) to set
10401
10482
  */
10402
10483
  setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
10403
10484
  /**
10485
+ * This method is **deprecated**.
10486
+ *
10404
10487
  * Return the current geo location
10405
10488
  * Resumes test execution, so **should be used inside async function with `await`** operator.
10406
10489
  *
@@ -4583,6 +4583,17 @@ declare namespace CodeceptJS {
4583
4583
  * @returns automatically synchronized promise through #recorder
4584
4584
  */
4585
4585
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4586
+ /**
4587
+ * Waits for number of tabs.
4588
+ *
4589
+ * ```js
4590
+ * I.waitForNumberOfTabs(2);
4591
+ * ```
4592
+ * @param expectedTabs - expecting the number of tabs.
4593
+ * @param sec - number of secs to wait.
4594
+ * @returns automatically synchronized promise through #recorder
4595
+ */
4596
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
4586
4597
  /**
4587
4598
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4588
4599
  *
@@ -7938,6 +7949,17 @@ declare namespace CodeceptJS {
7938
7949
  * @returns automatically synchronized promise through #recorder
7939
7950
  */
7940
7951
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7952
+ /**
7953
+ * Waits for number of tabs.
7954
+ *
7955
+ * ```js
7956
+ * I.waitForNumberOfTabs(2);
7957
+ * ```
7958
+ * @param expectedTabs - expecting the number of tabs.
7959
+ * @param sec - number of secs to wait.
7960
+ * @returns automatically synchronized promise through #recorder
7961
+ */
7962
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
7941
7963
  /**
7942
7964
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7943
7965
  *
@@ -9255,6 +9277,8 @@ declare namespace CodeceptJS {
9255
9277
  * @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
9256
9278
  * @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
9257
9279
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9280
+ * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9281
+ * @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
9258
9282
  */
9259
9283
  type WebDriverConfig = {
9260
9284
  url: string;
@@ -9277,6 +9301,8 @@ declare namespace CodeceptJS {
9277
9301
  manualStart?: boolean;
9278
9302
  timeouts?: any;
9279
9303
  highlightElement?: boolean;
9304
+ logLevel?: string;
9305
+ devtoolsProtocol?: boolean;
9280
9306
  };
9281
9307
  /**
9282
9308
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -9284,6 +9310,13 @@ declare namespace CodeceptJS {
9284
9310
  *
9285
9311
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
9286
9312
  *
9313
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
9314
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
9315
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
9316
+ *
9317
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
9318
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
9319
+ *
9287
9320
  * <!-- configuration -->
9288
9321
  *
9289
9322
  * Example:
@@ -9305,6 +9338,28 @@ declare namespace CodeceptJS {
9305
9338
  * }
9306
9339
  * ```
9307
9340
  *
9341
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
9342
+ * For example:
9343
+ *
9344
+ * ```js
9345
+ * {
9346
+ * helpers: {
9347
+ * WebDriver : {
9348
+ * smartWait: 5000,
9349
+ * browser: "chrome",
9350
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
9351
+ * restart: false,
9352
+ * windowSize: "maximize",
9353
+ * timeouts: {
9354
+ * "script": 60000,
9355
+ * "page load": 10000
9356
+ * }
9357
+ * }
9358
+ * }
9359
+ * }
9360
+ * ```
9361
+ *
9362
+ *
9308
9363
  * Example with basic authentication
9309
9364
  * ```js
9310
9365
  * {
@@ -9345,6 +9400,25 @@ declare namespace CodeceptJS {
9345
9400
  * }
9346
9401
  * ```
9347
9402
  *
9403
+ * ### Running with devtools protocol
9404
+ *
9405
+ * ```js
9406
+ * {
9407
+ * helpers: {
9408
+ * WebDriver : {
9409
+ * url: "http://localhost",
9410
+ * browser: "chrome",
9411
+ * devtoolsProtocol: true,
9412
+ * desiredCapabilities: {
9413
+ * chromeOptions: {
9414
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
9415
+ * }
9416
+ * }
9417
+ * }
9418
+ * }
9419
+ * }
9420
+ * ```
9421
+ *
9348
9422
  * ### Internet Explorer
9349
9423
  *
9350
9424
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -11016,6 +11090,17 @@ declare namespace CodeceptJS {
11016
11090
  * @returns automatically synchronized promise through #recorder
11017
11091
  */
11018
11092
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
11093
+ /**
11094
+ * Waits for number of tabs.
11095
+ *
11096
+ * ```js
11097
+ * I.waitForNumberOfTabs(2);
11098
+ * ```
11099
+ * @param expectedTabs - expecting the number of tabs.
11100
+ * @param sec - number of secs to wait.
11101
+ * @returns automatically synchronized promise through #recorder
11102
+ */
11103
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
11019
11104
  /**
11020
11105
  * Switches frame or in case of null locator reverts to parent.
11021
11106
  *
@@ -11117,6 +11202,9 @@ declare namespace CodeceptJS {
11117
11202
  */
11118
11203
  grabPageScrollPosition(): Promise<PageScrollPosition>;
11119
11204
  /**
11205
+ * This method is **deprecated**.
11206
+ *
11207
+ *
11120
11208
  * Set the current geo location
11121
11209
  *
11122
11210
  *
@@ -11126,11 +11214,13 @@ declare namespace CodeceptJS {
11126
11214
  * ```
11127
11215
  * @param latitude - to set.
11128
11216
  * @param longitude - to set
11129
- * @param [altitude = null] - (optional, null by default) to set
11217
+ * @param [altitude] - (optional, null by default) to set
11130
11218
  * @returns automatically synchronized promise through #recorder
11131
11219
  */
11132
11220
  setGeoLocation(latitude: number, longitude: number, altitude?: number): void;
11133
11221
  /**
11222
+ * This method is **deprecated**.
11223
+ *
11134
11224
  * Return the current geo location
11135
11225
  * Resumes test execution, so **should be used inside async function with `await`** operator.
11136
11226
  *
@@ -11513,7 +11603,10 @@ declare namespace CodeceptJS {
11513
11603
  isStrict(): boolean;
11514
11604
  isAccessibilityId(): boolean;
11515
11605
  isBasic(): boolean;
11516
- toXPath(): string;
11606
+ /**
11607
+ * @param [pseudoSelector] - CSS to XPath extension pseudo: https://www.npmjs.com/package/csstoxpath?activeTab=explore#extension-pseudos
11608
+ */
11609
+ toXPath(pseudoSelector?: string): string;
11517
11610
  or(locator: CodeceptJS.LocatorOrString): Locator;
11518
11611
  find(locator: CodeceptJS.LocatorOrString): Locator;
11519
11612
  withChild(locator: CodeceptJS.LocatorOrString): Locator;
@@ -11521,7 +11614,14 @@ declare namespace CodeceptJS {
11521
11614
  at(position: number): Locator;
11522
11615
  first(): Locator;
11523
11616
  last(): Locator;
11617
+ /**
11618
+ * Find an element containing a text
11619
+ */
11524
11620
  withText(text: string): Locator;
11621
+ /**
11622
+ * Find an element with exact text
11623
+ */
11624
+ withTextEquals(text: string): Locator;
11525
11625
  withAttr(attributes: {
11526
11626
  [key: string]: string;
11527
11627
  }): Locator;