@telefonica/acceptance-testing 2.14.0 → 2.15.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/dist/index.js.flow +0 -162
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/acceptance-testing",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "author": "Telefonica",
5
5
  "license": "UNLICENSED",
6
6
  "module": "dist/acceptance-testing.esm.js",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "scripts": {
22
22
  "start": "tsdx watch",
23
- "build": "tsdx build && cp src/index.js.flow dist/",
23
+ "build": "tsdx build",
24
24
  "test": "tsdx test",
25
25
  "lint": "tsdx lint src",
26
26
  "prepare": "tsdx build",
@@ -1,162 +0,0 @@
1
- // @flow
2
- import * as Puppeteer from 'puppeteer';
3
-
4
- export type ElementHandle = Puppeteer.ElementHandle;
5
- export type Browser = Puppeteer.Browser;
6
- export type Page = Puppeteer.Page;
7
- export type Viewport = Puppeteer.Viewport;
8
- export type ClickOptions = Puppeteer.ClickOptions;
9
-
10
- declare export var getGlobalBrowser: () => Browser;
11
- declare export var getGlobalPage: () => Page;
12
- declare export var serverHostName: string;
13
- declare export var serverPort: number;
14
-
15
- interface CustomScreenshotOptions extends Puppeteer.ScreenshotOptions {
16
- skipNetworkWait?: boolean;
17
- }
18
-
19
- export type PageApi = {
20
- ...Page,
21
- clear: (selector: ElementHandle) => Promise<void>,
22
- // These are overridden:
23
- type: (selector: ElementHandle, text: string, options?: {delay: number}) => Promise<void>,
24
- click: (selector: ElementHandle, options?: ClickOptions) => Promise<void>,
25
- select: (selector: ElementHandle, ...values: Array<string>) => Promise<Array<string>>,
26
- screenshot: (options?: CustomScreenshotOptions) => Promise<Buffer | string | void>,
27
- };
28
-
29
- type CookieConfig = {
30
- name: string,
31
- value: string,
32
- url?: string,
33
- domain?: string,
34
- path?: string,
35
- secure?: boolean,
36
- httpOnly?: boolean,
37
- sameSite?: 'Strict' | 'Lax' | 'None',
38
- expires?: number,
39
- priority?: 'Low' | 'Medium' | 'High',
40
- sameParty?: boolean,
41
- sourceScheme?: 'Unset' | 'NonSecure' | 'Secure',
42
- sourcePort?: number,
43
- };
44
-
45
- type OpenPageCommonConfig = {
46
- userAgent?: string,
47
- viewport?: Viewport,
48
- isDarkMode?: boolean,
49
- cookies?: Array<CookieConfig>,
50
- };
51
-
52
- type OpenPageUrlConfig = {
53
- ...OpenPageCommonConfig,
54
- url: string,
55
- };
56
-
57
- type OpenPagePathConfig = {
58
- ...OpenPageCommonConfig,
59
- path?: string,
60
- port?: number,
61
- protocol?: string,
62
- hostname?: string,
63
- };
64
-
65
- type OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;
66
-
67
- declare export var openPage: (config: OpenPageConfig) => Promise<PageApi>;
68
-
69
- type Matcher = string | RegExp;
70
-
71
- type MatcherOptions = {
72
- exact?: boolean,
73
- trim?: boolean,
74
- collapseWhitespace?: boolean,
75
- suggest?: boolean,
76
- selector?: string,
77
- ignore?: boolean | string,
78
- };
79
-
80
- type RoleMatcherOptions = {
81
- ...MatcherOptions,
82
- name?: string | RegExp,
83
- };
84
-
85
- type WaitForOptions = {
86
- container?: ElementHandle,
87
- timeout?: number,
88
- interval?: number,
89
- onTimeout?: (error: Error) => Error,
90
- mutationObserverOptions?: MutationObserverInit,
91
- };
92
-
93
- type Queries = {
94
- findByPlaceholderText(
95
- m: Matcher,
96
- opts?: MatcherOptions,
97
- waitForOpts?: WaitForOptions
98
- ): Promise<ElementHandle>,
99
- findAllByPlaceholderText(
100
- m: Matcher,
101
- opts?: MatcherOptions,
102
- waitForOpts?: WaitForOptions
103
- ): Promise<Array<ElementHandle>>,
104
- findByText(m: Matcher, opts?: MatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
105
- findAllByText(
106
- m: Matcher,
107
- opts?: MatcherOptions,
108
- waitForOpts?: WaitForOptions
109
- ): Promise<Array<ElementHandle>>,
110
- findByLabelText(m: Matcher, opts?: MatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
111
- findAllByLabelText(
112
- m: Matcher,
113
- opts?: MatcherOptions,
114
- waitForOpts?: WaitForOptions
115
- ): Promise<Array<ElementHandle>>,
116
- findByAltText(m: Matcher, opts?: MatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
117
- findAllByAltText(
118
- m: Matcher,
119
- opts?: MatcherOptions,
120
- waitForOpts?: WaitForOptions
121
- ): Promise<Array<ElementHandle>>,
122
- findByTestId(m: Matcher, opts?: MatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
123
- findAllByTestId(
124
- m: Matcher,
125
- opts?: MatcherOptions,
126
- waitForOpts?: WaitForOptions
127
- ): Promise<Array<ElementHandle>>,
128
- findByTitle(m: Matcher, opts?: MatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
129
- findAllByTitle(
130
- m: Matcher,
131
- opts?: MatcherOptions,
132
- waitForOpts?: WaitForOptions
133
- ): Promise<Array<ElementHandle>>,
134
- findByRole(m: Matcher, opts?: RoleMatcherOptions, waitForOpts?: WaitForOptions): Promise<ElementHandle>,
135
- findAllByRole(
136
- m: Matcher,
137
- opts?: RoleMatcherOptions,
138
- waitForOpts?: WaitForOptions
139
- ): Promise<Array<ElementHandle>>,
140
- findByDisplayValue(
141
- m: Matcher,
142
- opts?: MatcherOptions,
143
- waitForOpts?: WaitForOptions
144
- ): Promise<ElementHandle>,
145
- findAllByDisplayValue(
146
- m: Matcher,
147
- opts?: MatcherOptions,
148
- waitForOpts?: WaitForOptions
149
- ): Promise<Array<ElementHandle>>,
150
- };
151
-
152
- declare export var getScreen: (page: Page) => Queries;
153
- declare export var getPageApi: (page: Page) => PageApi;
154
- declare export var screen: Queries;
155
- declare export var within: (element: ElementHandle) => Queries;
156
-
157
- declare export var interceptRequest: (matcher: (req: Puppeteer.Request) => boolean) => JestMockFn<any, any>;
158
- declare export var createApiEndpointMock: (options: {baseUrl: string}) => {
159
- spyOn: (path: string, method?: string) => JestMockFn<[Puppeteer.Request], mixed>,
160
- };
161
-
162
- declare export var prepareFile: (filepath: string) => string;