codeceptjs 3.5.14 → 3.6.0-beta.1.ai-healers

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.
Files changed (137) hide show
  1. package/README.md +2 -2
  2. package/bin/codecept.js +66 -30
  3. package/docs/advanced.md +351 -0
  4. package/docs/ai.md +365 -0
  5. package/docs/api.md +323 -0
  6. package/docs/basics.md +979 -0
  7. package/docs/bdd.md +539 -0
  8. package/docs/best.md +237 -0
  9. package/docs/books.md +37 -0
  10. package/docs/bootstrap.md +135 -0
  11. package/docs/build/AI.js +124 -0
  12. package/docs/build/ApiDataFactory.js +410 -0
  13. package/docs/build/Appium.js +2027 -0
  14. package/docs/build/Expect.js +422 -0
  15. package/docs/build/FileSystem.js +228 -0
  16. package/docs/build/GraphQL.js +229 -0
  17. package/docs/build/GraphQLDataFactory.js +309 -0
  18. package/docs/build/JSONResponse.js +338 -0
  19. package/docs/build/Mochawesome.js +71 -0
  20. package/docs/build/Nightmare.js +2152 -0
  21. package/docs/build/Playwright.js +5110 -0
  22. package/docs/build/Protractor.js +2706 -0
  23. package/docs/build/Puppeteer.js +3905 -0
  24. package/docs/build/REST.js +344 -0
  25. package/docs/build/TestCafe.js +2125 -0
  26. package/docs/build/WebDriver.js +4240 -0
  27. package/docs/changelog.md +2572 -0
  28. package/docs/commands.md +266 -0
  29. package/docs/community-helpers.md +58 -0
  30. package/docs/configuration.md +157 -0
  31. package/docs/continuous-integration.md +22 -0
  32. package/docs/custom-helpers.md +306 -0
  33. package/docs/data.md +379 -0
  34. package/docs/detox.md +235 -0
  35. package/docs/docker.md +136 -0
  36. package/docs/email.md +183 -0
  37. package/docs/examples.md +149 -0
  38. package/docs/heal.md +186 -0
  39. package/docs/helpers/ApiDataFactory.md +266 -0
  40. package/docs/helpers/Appium.md +1374 -0
  41. package/docs/helpers/Detox.md +586 -0
  42. package/docs/helpers/Expect.md +275 -0
  43. package/docs/helpers/FileSystem.md +152 -0
  44. package/docs/helpers/GraphQL.md +151 -0
  45. package/docs/helpers/GraphQLDataFactory.md +226 -0
  46. package/docs/helpers/JSONResponse.md +254 -0
  47. package/docs/helpers/Mochawesome.md +8 -0
  48. package/docs/helpers/MockRequest.md +377 -0
  49. package/docs/helpers/Nightmare.md +1305 -0
  50. package/docs/helpers/OpenAI.md +70 -0
  51. package/docs/helpers/Playwright.md +2759 -0
  52. package/docs/helpers/Polly.md +44 -0
  53. package/docs/helpers/Protractor.md +1769 -0
  54. package/docs/helpers/Puppeteer-firefox.md +86 -0
  55. package/docs/helpers/Puppeteer.md +2317 -0
  56. package/docs/helpers/REST.md +218 -0
  57. package/docs/helpers/TestCafe.md +1321 -0
  58. package/docs/helpers/WebDriver.md +2547 -0
  59. package/docs/hooks.md +340 -0
  60. package/docs/index.md +111 -0
  61. package/docs/installation.md +75 -0
  62. package/docs/internal-api.md +266 -0
  63. package/docs/locators.md +339 -0
  64. package/docs/mobile-react-native-locators.md +67 -0
  65. package/docs/mobile.md +338 -0
  66. package/docs/pageobjects.md +291 -0
  67. package/docs/parallel.md +400 -0
  68. package/docs/playwright.md +632 -0
  69. package/docs/plugins.md +1247 -0
  70. package/docs/puppeteer.md +316 -0
  71. package/docs/quickstart.md +162 -0
  72. package/docs/react.md +70 -0
  73. package/docs/reports.md +392 -0
  74. package/docs/secrets.md +36 -0
  75. package/docs/shadow.md +68 -0
  76. package/docs/shared/keys.mustache +31 -0
  77. package/docs/shared/react.mustache +1 -0
  78. package/docs/testcafe.md +174 -0
  79. package/docs/translation.md +247 -0
  80. package/docs/tutorial.md +271 -0
  81. package/docs/typescript.md +180 -0
  82. package/docs/ui.md +59 -0
  83. package/docs/videos.md +28 -0
  84. package/docs/visual.md +202 -0
  85. package/docs/vue.md +143 -0
  86. package/docs/webdriver.md +701 -0
  87. package/docs/wiki/Books-&-Posts.md +27 -0
  88. package/docs/wiki/Community-Helpers-&-Plugins.md +53 -0
  89. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +61 -0
  90. package/docs/wiki/Examples.md +145 -0
  91. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +68 -0
  92. package/docs/wiki/Home.md +16 -0
  93. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +83 -0
  94. package/docs/wiki/Release-Process.md +24 -0
  95. package/docs/wiki/Roadmap.md +23 -0
  96. package/docs/wiki/Tests.md +1393 -0
  97. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +153 -0
  98. package/docs/wiki/Videos.md +19 -0
  99. package/lib/actor.js +3 -6
  100. package/lib/ai.js +152 -80
  101. package/lib/cli.js +1 -0
  102. package/lib/command/generate.js +34 -0
  103. package/lib/command/run-workers.js +3 -0
  104. package/lib/command/run.js +3 -0
  105. package/lib/container.js +2 -0
  106. package/lib/heal.js +172 -0
  107. package/lib/helper/AI.js +124 -0
  108. package/lib/helper/Appium.js +12 -36
  109. package/lib/helper/Expect.js +7 -10
  110. package/lib/helper/JSONResponse.js +8 -8
  111. package/lib/helper/Playwright.js +240 -100
  112. package/lib/helper/Puppeteer.js +9 -61
  113. package/lib/helper/REST.js +1 -4
  114. package/lib/helper/WebDriver.js +10 -324
  115. package/lib/index.js +3 -0
  116. package/lib/listener/steps.js +0 -2
  117. package/lib/locator.js +4 -13
  118. package/lib/plugin/heal.js +26 -117
  119. package/lib/recorder.js +11 -5
  120. package/lib/step.js +1 -3
  121. package/lib/store.js +2 -0
  122. package/lib/template/heal.js +39 -0
  123. package/package.json +23 -27
  124. package/typings/index.d.ts +0 -16
  125. package/typings/promiseBasedTypes.d.ts +55 -338
  126. package/typings/types.d.ts +58 -353
  127. package/docs/webapi/dontSeeTraffic.mustache +0 -13
  128. package/docs/webapi/flushNetworkTraffics.mustache +0 -5
  129. package/docs/webapi/grabRecordedNetworkTraffics.mustache +0 -10
  130. package/docs/webapi/seeTraffic.mustache +0 -36
  131. package/docs/webapi/startRecordingTraffic.mustache +0 -8
  132. package/docs/webapi/stopRecordingTraffic.mustache +0 -5
  133. package/docs/webapi/waitForCookie.mustache +0 -9
  134. package/lib/helper/MockServer.js +0 -221
  135. package/lib/helper/errors/ElementAssertion.js +0 -38
  136. package/lib/helper/networkTraffics/utils.js +0 -137
  137. /package/{lib/helper → docs/build}/OpenAI.js +0 -0
@@ -1,4 +1,44 @@
1
1
  declare namespace CodeceptJS {
2
+ /**
3
+ * AI Helper for CodeceptJS.
4
+ *
5
+ * This helper class provides integration with the AI GPT-3.5 or 4 language model for generating responses to questions or prompts within the context of web pages. It allows you to interact with the GPT-3.5 model to obtain intelligent responses based on HTML fragments or general prompts.
6
+ * This helper should be enabled with any web helpers like Playwright or Puppeteer or WebDrvier to ensure the HTML context is available.
7
+ *
8
+ * ## Configuration
9
+ *
10
+ * This helper should be configured in codecept.json or codecept.conf.js
11
+ *
12
+ * * `chunkSize`: (optional, default: 80000) - The maximum number of characters to send to the AI API at once. We split HTML fragments by 8000 chars to not exceed token limit. Increase this value if you use GPT-4.
13
+ */
14
+ class AI {
15
+ /**
16
+ * Asks the AI GPT language model a question based on the provided prompt within the context of the current page's HTML.
17
+ *
18
+ * ```js
19
+ * I.askGptOnPage('what does this page do?');
20
+ * ```
21
+ * @param prompt - The question or prompt to ask the GPT model.
22
+ * @returns - A Promise that resolves to the generated responses from the GPT model, joined by newlines.
23
+ */
24
+ askGptOnPage(prompt: string): Promise<string>;
25
+ /**
26
+ * Asks the AI a question based on the provided prompt within the context of a specific HTML fragment on the current page.
27
+ *
28
+ * ```js
29
+ * I.askGptOnPageFragment('describe features of this screen', '.screen');
30
+ * ```
31
+ * @param prompt - The question or prompt to ask the GPT-3.5 model.
32
+ * @param locator - The locator or selector used to identify the HTML fragment on the page.
33
+ * @returns - A Promise that resolves to the generated response from the GPT model.
34
+ */
35
+ askGptOnPageFragment(prompt: string, locator: string): Promise<string>;
36
+ /**
37
+ * Send a general request to ChatGPT and return response.
38
+ * @returns - A Promise that resolves to the generated response from the GPT model.
39
+ */
40
+ askGptGeneralPrompt(prompt: string): Promise<string>;
41
+ }
2
42
  /**
3
43
  * Helper for managing remote data using REST API.
4
44
  * Uses data generators like [rosie](https://github.com/rosiejs/rosie) or factory girl to create new record.
@@ -1759,191 +1799,6 @@ declare namespace CodeceptJS {
1759
1799
  */
1760
1800
  seeResponseMatchesJsonSchema(fnOrSchema: any): void;
1761
1801
  }
1762
- /**
1763
- * ## Configuration
1764
- *
1765
- * This helper should be configured in codecept.conf.(js|ts)
1766
- * @property [port = 9393] - Mock server port
1767
- * @property [host = "0.0.0.0"] - Mock server host
1768
- * @property [httpsOpts] - key & cert values are the paths to .key and .crt files
1769
- */
1770
- type MockServerConfig = {
1771
- port?: number;
1772
- host?: string;
1773
- httpsOpts?: any;
1774
- };
1775
- /**
1776
- * MockServer
1777
- *
1778
- * The MockServer Helper in CodeceptJS empowers you to mock any server or service via HTTP or HTTPS, making it an excellent tool for simulating REST endpoints and other HTTP-based APIs.
1779
- *
1780
- * <!-- configuration -->
1781
- *
1782
- * #### Examples
1783
- *
1784
- * You can seamlessly integrate MockServer with other helpers like REST or Playwright. Here's a configuration example inside the `codecept.conf.js` file:
1785
- *
1786
- * ```javascript
1787
- * {
1788
- * helpers: {
1789
- * REST: {...},
1790
- * MockServer: {
1791
- * // default mock server config
1792
- * port: 9393,
1793
- * host: '0.0.0.0',
1794
- * httpsOpts: {
1795
- * key: '',
1796
- * cert: '',
1797
- * },
1798
- * },
1799
- * }
1800
- * }
1801
- * ```
1802
- *
1803
- * #### Adding Interactions
1804
- *
1805
- * Interactions add behavior to the mock server. Use the `I.addInteractionToMockServer()` method to include interactions. It takes an interaction object as an argument, containing request and response details.
1806
- *
1807
- * ```javascript
1808
- * I.addInteractionToMockServer({
1809
- * request: {
1810
- * method: 'GET',
1811
- * path: '/api/hello'
1812
- * },
1813
- * response: {
1814
- * status: 200,
1815
- * body: {
1816
- * 'say': 'hello to mock server'
1817
- * }
1818
- * }
1819
- * });
1820
- * ```
1821
- *
1822
- * #### Request Matching
1823
- *
1824
- * When a real request is sent to the mock server, it matches the received request with the interactions. If a match is found, it returns the specified response; otherwise, a 404 status code is returned.
1825
- *
1826
- * - Strong match on HTTP Method, Path, Query Params & JSON body.
1827
- * - Loose match on Headers.
1828
- *
1829
- * ##### Strong Match on Query Params
1830
- *
1831
- * You can send different responses based on query parameters:
1832
- *
1833
- * ```javascript
1834
- * I.addInteractionToMockServer({
1835
- * request: {
1836
- * method: 'GET',
1837
- * path: '/api/users',
1838
- * queryParams: {
1839
- * id: 1
1840
- * }
1841
- * },
1842
- * response: {
1843
- * status: 200,
1844
- * body: 'user 1'
1845
- * }
1846
- * });
1847
- *
1848
- * I.addInteractionToMockServer({
1849
- * request: {
1850
- * method: 'GET',
1851
- * path: '/api/users',
1852
- * queryParams: {
1853
- * id: 2
1854
- * }
1855
- * },
1856
- * response: {
1857
- * status: 200,
1858
- * body: 'user 2'
1859
- * }
1860
- * });
1861
- * ```
1862
- *
1863
- * - GET to `/api/users?id=1` will return 'user 1'.
1864
- * - GET to `/api/users?id=2` will return 'user 2'.
1865
- * - For all other requests, it returns a 404 status code.
1866
- *
1867
- * ##### Loose Match on Body
1868
- *
1869
- * When `strict` is set to false, it performs a loose match on query params and response body:
1870
- *
1871
- * ```javascript
1872
- * I.addInteractionToMockServer({
1873
- * strict: false,
1874
- * request: {
1875
- * method: 'POST',
1876
- * path: '/api/users',
1877
- * body: {
1878
- * name: 'john'
1879
- * }
1880
- * },
1881
- * response: {
1882
- * status: 200
1883
- * }
1884
- * });
1885
- * ```
1886
- *
1887
- * - POST to `/api/users` with the body containing `name` as 'john' will return a 200 status code.
1888
- * - POST to `/api/users` without the `name` property in the body will return a 404 status code.
1889
- *
1890
- * Happy testing with MockServer in CodeceptJS! 🚀
1891
- *
1892
- * ## Methods
1893
- */
1894
- class MockServer {
1895
- /**
1896
- * Start the mock server
1897
- * @param [port] - start the mock server with given port
1898
- * @returns void
1899
- */
1900
- startMockServer(port?: number): any;
1901
- /**
1902
- * Stop the mock server
1903
- * @returns void
1904
- */
1905
- stopMockServer(): any;
1906
- /**
1907
- * An interaction adds behavior to the mock server
1908
- *
1909
- *
1910
- * ```js
1911
- * I.addInteractionToMockServer({
1912
- * request: {
1913
- * method: 'GET',
1914
- * path: '/api/hello'
1915
- * },
1916
- * response: {
1917
- * status: 200,
1918
- * body: {
1919
- * 'say': 'hello to mock server'
1920
- * }
1921
- * }
1922
- * });
1923
- * ```
1924
- * ```js
1925
- * // with query params
1926
- * I.addInteractionToMockServer({
1927
- * request: {
1928
- * method: 'GET',
1929
- * path: '/api/hello',
1930
- * queryParams: {
1931
- * id: 2
1932
- * }
1933
- * },
1934
- * response: {
1935
- * status: 200,
1936
- * body: {
1937
- * 'say': 'hello to mock server'
1938
- * }
1939
- * }
1940
- * });
1941
- * ```
1942
- * @param interaction - add behavior to the mock server
1943
- * @returns void
1944
- */
1945
- addInteractionToMockServer(interaction: CodeceptJS.MockInteraction | any): any;
1946
- }
1947
1802
  /**
1948
1803
  * Nightmare helper wraps [Nightmare](https://github.com/segmentio/nightmare) library to provide
1949
1804
  * fastest headless testing using Electron engine. Unlike Selenium-based drivers this uses
@@ -4892,17 +4747,6 @@ declare namespace CodeceptJS {
4892
4747
  * @returns automatically synchronized promise through #recorder
4893
4748
  */
4894
4749
  waitForDetached(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4895
- /**
4896
- * Waits for the specified cookie in the cookies.
4897
- *
4898
- * ```js
4899
- * I.waitForCookie("token");
4900
- * ```
4901
- * @param name - expected cookie name.
4902
- * @param [sec = 3] - (optional, `3` by default) time in seconds to wait
4903
- * @returns automatically synchronized promise through #recorder
4904
- */
4905
- waitForCookie(name: string, sec?: number): void;
4906
4750
  /**
4907
4751
  * Grab the data from performance timing using Navigation Timing API.
4908
4752
  * The returned data will contain following things in ms:
@@ -4973,10 +4817,11 @@ declare namespace CodeceptJS {
4973
4817
  */
4974
4818
  stopMockingRoute(url?: string | RegExp, handler?: (...params: any[]) => any): void;
4975
4819
  /**
4976
- * Resets all recorded network requests.
4820
+ * Starts recording the network traffics.
4821
+ * This also resets recorded network requests.
4977
4822
  *
4978
4823
  * ```js
4979
- * I.flushNetworkTraffics();
4824
+ * I.startRecordingTraffic();
4980
4825
  * ```
4981
4826
  */
4982
4827
  startRecordingTraffic(): void;
@@ -4989,9 +4834,8 @@ declare namespace CodeceptJS {
4989
4834
  * expect(traffics[0].response.status).to.equal(200);
4990
4835
  * expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
4991
4836
  * ```
4992
- * @returns recorded network traffics
4993
4837
  */
4994
- grabRecordedNetworkTraffics(): any[];
4838
+ grabRecordedNetworkTraffics(): Promise<any[]>;
4995
4839
  /**
4996
4840
  * Blocks traffic of a given URL or a list of URLs.
4997
4841
  *
@@ -5028,10 +4872,6 @@ declare namespace CodeceptJS {
5028
4872
  mockTraffic(urls: any, responseString: any, contentType?: any): void;
5029
4873
  /**
5030
4874
  * Resets all recorded network requests.
5031
- *
5032
- * ```js
5033
- * I.flushNetworkTraffics();
5034
- * ```
5035
4875
  */
5036
4876
  flushNetworkTraffics(): void;
5037
4877
  /**
@@ -5050,13 +4890,13 @@ declare namespace CodeceptJS {
5050
4890
  * I.amOnPage('https://openai.com/blog/chatgpt');
5051
4891
  * I.startRecordingTraffic();
5052
4892
  * await I.seeTraffic({
5053
- * name: 'sentry event',
5054
- * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
5055
- * parameters: {
5056
- * width: '1919',
5057
- * height: '1138',
4893
+ * name: 'sentry event',
4894
+ * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
4895
+ * parameters: {
4896
+ * width: '1919',
4897
+ * height: '1138',
5058
4898
  * },
5059
- * });
4899
+ * });
5060
4900
  * ```
5061
4901
  *
5062
4902
  * ```js
@@ -5064,12 +4904,12 @@ declare namespace CodeceptJS {
5064
4904
  * I.amOnPage('https://openai.com/blog/chatgpt');
5065
4905
  * I.startRecordingTraffic();
5066
4906
  * await I.seeTraffic({
5067
- * name: 'event',
5068
- * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
5069
- * requestPostData: {
5070
- * st: 2,
4907
+ * name: 'event',
4908
+ * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
4909
+ * requestPostData: {
4910
+ * st: 2,
5071
4911
  * },
5072
- * });
4912
+ * });
5073
4913
  * ```
5074
4914
  * @param opts - options when checking the traffic network.
5075
4915
  * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
@@ -5077,7 +4917,6 @@ declare namespace CodeceptJS {
5077
4917
  * @param [opts.parameters] - Expected parameters of that request in network traffic
5078
4918
  * @param [opts.requestPostData] - Expected that request contains post data in network traffic
5079
4919
  * @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
5080
- * @returns automatically synchronized promise through #recorder
5081
4920
  */
5082
4921
  seeTraffic(opts: {
5083
4922
  name: string;
@@ -5085,7 +4924,7 @@ declare namespace CodeceptJS {
5085
4924
  parameters?: any;
5086
4925
  requestPostData?: any;
5087
4926
  timeout?: number;
5088
- }): void;
4927
+ }): Promise<any>;
5089
4928
  /**
5090
4929
  * Returns full URL of request matching parameter "urlMatch".
5091
4930
  * @param urlMatch - Expected URL of request in network traffic. Can be a string or a regular expression.
@@ -5110,7 +4949,6 @@ declare namespace CodeceptJS {
5110
4949
  * @param opts - options when checking the traffic network.
5111
4950
  * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
5112
4951
  * @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
5113
- * @returns automatically synchronized promise through #recorder
5114
4952
  */
5115
4953
  dontSeeTraffic(opts: {
5116
4954
  name: string;
@@ -7774,17 +7612,6 @@ declare namespace CodeceptJS {
7774
7612
  * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
7775
7613
  */
7776
7614
  grabCookie(name?: string): any;
7777
- /**
7778
- * Waits for the specified cookie in the cookies.
7779
- *
7780
- * ```js
7781
- * I.waitForCookie("token");
7782
- * ```
7783
- * @param name - expected cookie name.
7784
- * @param [sec = 3] - (optional, `3` by default) time in seconds to wait
7785
- * @returns automatically synchronized promise through #recorder
7786
- */
7787
- waitForCookie(name: string, sec?: number): void;
7788
7615
  /**
7789
7616
  * Clears a cookie by name,
7790
7617
  * if none provided clears all cookies.
@@ -10880,17 +10707,6 @@ declare namespace CodeceptJS {
10880
10707
  * @returns attribute value
10881
10708
  */
10882
10709
  grabCookie(name?: string): any;
10883
- /**
10884
- * Waits for the specified cookie in the cookies.
10885
- *
10886
- * ```js
10887
- * I.waitForCookie("token");
10888
- * ```
10889
- * @param name - expected cookie name.
10890
- * @param [sec = 3] - (optional, `3` by default) time in seconds to wait
10891
- * @returns automatically synchronized promise through #recorder
10892
- */
10893
- waitForCookie(name: string, sec?: number): void;
10894
10710
  /**
10895
10711
  * Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
10896
10712
  * Don't confuse popups with modal windows, as created by [various
@@ -11484,122 +11300,10 @@ declare namespace CodeceptJS {
11484
11300
  * Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
11485
11301
  */
11486
11302
  runInWeb(): void;
11487
- /**
11488
- * _Note:_ Only works when devtoolsProtocol is enabled.
11489
- *
11490
- * Resets all recorded network requests.
11491
- *
11492
- * ```js
11493
- * I.flushNetworkTraffics();
11494
- * ```
11495
- */
11496
- flushNetworkTraffics(): void;
11497
- /**
11498
- * _Note:_ Only works when devtoolsProtocol is enabled.
11499
- *
11500
- * Stops recording of network traffic. Recorded traffic is not flashed.
11501
- *
11502
- * ```js
11503
- * I.stopRecordingTraffic();
11504
- * ```
11505
- */
11506
- stopRecordingTraffic(): void;
11507
- /**
11508
- * _Note:_ Only works when devtoolsProtocol is enabled.
11509
- *
11510
- * Starts recording the network traffics.
11511
- * This also resets recorded network requests.
11512
- *
11513
- * ```js
11514
- * I.startRecordingTraffic();
11515
- * ```
11516
- * @returns automatically synchronized promise through #recorder
11517
- */
11518
- startRecordingTraffic(): void;
11519
- /**
11520
- * _Note:_ Only works when devtoolsProtocol is enabled.
11521
- *
11522
- * Grab the recording network traffics
11523
- *
11524
- * ```js
11525
- * const traffics = await I.grabRecordedNetworkTraffics();
11526
- * expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
11527
- * expect(traffics[0].response.status).to.equal(200);
11528
- * expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
11529
- * ```
11530
- * @returns recorded network traffics
11531
- */
11532
- grabRecordedNetworkTraffics(): any[];
11533
- /**
11534
- * _Note:_ Only works when devtoolsProtocol is enabled.
11535
- *
11536
- * Verifies that a certain request is part of network traffic.
11537
- *
11538
- * ```js
11539
- * // checking the request url contains certain query strings
11540
- * I.amOnPage('https://openai.com/blog/chatgpt');
11541
- * I.startRecordingTraffic();
11542
- * await I.seeTraffic({
11543
- * name: 'sentry event',
11544
- * url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
11545
- * parameters: {
11546
- * width: '1919',
11547
- * height: '1138',
11548
- * },
11549
- * });
11550
- * ```
11551
- *
11552
- * ```js
11553
- * // checking the request url contains certain post data
11554
- * I.amOnPage('https://openai.com/blog/chatgpt');
11555
- * I.startRecordingTraffic();
11556
- * await I.seeTraffic({
11557
- * name: 'event',
11558
- * url: 'https://cloudflareinsights.com/cdn-cgi/rum',
11559
- * requestPostData: {
11560
- * st: 2,
11561
- * },
11562
- * });
11563
- * ```
11564
- * @param opts - options when checking the traffic network.
11565
- * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
11566
- * @param opts.url - Expected URL of request in network traffic
11567
- * @param [opts.parameters] - Expected parameters of that request in network traffic
11568
- * @param [opts.requestPostData] - Expected that request contains post data in network traffic
11569
- * @param [opts.timeout] - Timeout to wait for request in seconds. Default is 10 seconds.
11570
- * @returns automatically synchronized promise through #recorder
11571
- */
11572
- seeTraffic(opts: {
11573
- name: string;
11574
- url: string;
11575
- parameters?: any;
11576
- requestPostData?: any;
11577
- timeout?: number;
11578
- }): void;
11579
- /**
11580
- * _Note:_ Only works when devtoolsProtocol is enabled.
11581
- *
11582
- * Verifies that a certain request is not part of network traffic.
11583
- *
11584
- * Examples:
11585
- *
11586
- * ```js
11587
- * I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
11588
- * I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
11589
- * ```
11590
- * @param opts - options when checking the traffic network.
11591
- * @param opts.name - A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
11592
- * @param opts.url - Expected URL of request in network traffic. Can be a string or a regular expression.
11593
- * @returns automatically synchronized promise through #recorder
11594
- */
11595
- dontSeeTraffic(opts: {
11596
- name: string;
11597
- url: string | RegExp;
11598
- }): void;
11599
11303
  }
11600
11304
  interface ActorStatic {
11601
11305
  /**
11602
- * Print the comment on log. Also, adding a step in the `Test.steps` object
11306
+ * add print comment method`
11603
11307
  */
11604
11308
  say(msg: string, color?: string): void;
11605
11309
  /**
@@ -12157,6 +11861,7 @@ declare namespace CodeceptJS {
12157
11861
  namespace store {
12158
11862
  var debugMode: boolean;
12159
11863
  var timeouts: boolean;
11864
+ var dryRun: boolean;
12160
11865
  }
12161
11866
  /**
12162
11867
  * Describe a "suite" with the given `title`
@@ -1,13 +0,0 @@
1
- Verifies that a certain request is not part of network traffic.
2
-
3
- Examples:
4
-
5
- ```js
6
- I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
7
- I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
8
- ```
9
-
10
- @param {Object} opts - options when checking the traffic network.
11
- @param {string} opts.name A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
12
- @param {string|RegExp} opts.url Expected URL of request in network traffic. Can be a string or a regular expression.
13
- @return {void} automatically synchronized promise through #recorder
@@ -1,5 +0,0 @@
1
- Resets all recorded network requests.
2
-
3
- ```js
4
- I.flushNetworkTraffics();
5
- ```
@@ -1,10 +0,0 @@
1
- Grab the recording network traffics
2
-
3
- ```js
4
- const traffics = await I.grabRecordedNetworkTraffics();
5
- expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
6
- expect(traffics[0].response.status).to.equal(200);
7
- expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
8
- ```
9
-
10
- @return { Array } recorded network traffics
@@ -1,36 +0,0 @@
1
- Verifies that a certain request is part of network traffic.
2
-
3
- ```js
4
- // checking the request url contains certain query strings
5
- I.amOnPage('https://openai.com/blog/chatgpt');
6
- I.startRecordingTraffic();
7
- await I.seeTraffic({
8
- name: 'sentry event',
9
- url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
10
- parameters: {
11
- width: '1919',
12
- height: '1138',
13
- },
14
- });
15
- ```
16
-
17
- ```js
18
- // checking the request url contains certain post data
19
- I.amOnPage('https://openai.com/blog/chatgpt');
20
- I.startRecordingTraffic();
21
- await I.seeTraffic({
22
- name: 'event',
23
- url: 'https://cloudflareinsights.com/cdn-cgi/rum',
24
- requestPostData: {
25
- st: 2,
26
- },
27
- });
28
- ```
29
-
30
- @param {Object} opts - options when checking the traffic network.
31
- @param {string} opts.name A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
32
- @param {string} opts.url Expected URL of request in network traffic
33
- @param {Object} [opts.parameters] Expected parameters of that request in network traffic
34
- @param {Object} [opts.requestPostData] Expected that request contains post data in network traffic
35
- @param {number} [opts.timeout] Timeout to wait for request in seconds. Default is 10 seconds.
36
- @return {void} automatically synchronized promise through #recorder
@@ -1,8 +0,0 @@
1
- Starts recording the network traffics.
2
- This also resets recorded network requests.
3
-
4
- ```js
5
- I.startRecordingTraffic();
6
- ```
7
-
8
- @returns {void} automatically synchronized promise through #recorder
@@ -1,5 +0,0 @@
1
- Stops recording of network traffic. Recorded traffic is not flashed.
2
-
3
- ```js
4
- I.stopRecordingTraffic();
5
- ```
@@ -1,9 +0,0 @@
1
- Waits for the specified cookie in the cookies.
2
-
3
- ```js
4
- I.waitForCookie("token");
5
- ```
6
-
7
- @param {string} name expected cookie name.
8
- @param {number} [sec=3] (optional, `3` by default) time in seconds to wait
9
- @returns {void} automatically synchronized promise through #recorder