@cepharum/contextual-gherkin 3.0.0-beta.2 → 3.0.0-beta.4

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/index.d.ts +10 -12
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare module "@cepharum/contextual-gherkin" {
2
- import {Browser, BrowserContextOptions, Expect, Mouse, Page} from "@playwright/test";
2
+ import {Browser, BrowserContextOptions, Expect, Mouse} from "@playwright/test";
3
3
 
4
4
  /**
5
5
  * Exposes helper functions for conveniently integrating contextual-gherkin
@@ -28,7 +28,7 @@ declare module "@cepharum/contextual-gherkin" {
28
28
  * Implements singleton API instance for interacting with contextual-gherkin
29
29
  * in current runtime.
30
30
  */
31
- class Api<B = BrowserAdapter, A = Expect, C = AbstractContext> {
31
+ class Api<B = BrowserAdapter, C = AbstractContext> {
32
32
  /**
33
33
  * Creates singleton instance of contextual-gherkin API in current
34
34
  * runtime on first invocation or augments configuration of existing
@@ -43,7 +43,7 @@ declare module "@cepharum/contextual-gherkin" {
43
43
  * Provides singleton instance of current runtime's contextual-gherkin
44
44
  * API for interacting with content of one or more browser views.
45
45
  */
46
- static access(): Api;
46
+ static access<BA = BrowserAdapter, AC = AbstractContext>(): Api<BA, AS, AC>;
47
47
 
48
48
  /**
49
49
  * Exposes normalized configuration of contextual-gherkin.
@@ -66,7 +66,7 @@ declare module "@cepharum/contextual-gherkin" {
66
66
  * Exposes assertions library for assessing state of contexts addressing
67
67
  * elements in a document.
68
68
  */
69
- expect: A;
69
+ expect: Expect;
70
70
 
71
71
  /**
72
72
  * Fetches view considered current one.
@@ -226,7 +226,7 @@ declare module "@cepharum/contextual-gherkin" {
226
226
  * Describes interface for interacting with a framework actually controlling
227
227
  * browsers, inspecting documents and performing actions on its content.
228
228
  */
229
- abstract class BrowserAdapter<A = Expect, C = AbstractContext> {
229
+ abstract class BrowserAdapter<C = AbstractContext> {
230
230
  /**
231
231
  * Creates (another) view for presenting documents, querying and
232
232
  * interacting with their elements.
@@ -235,7 +235,7 @@ declare module "@cepharum/contextual-gherkin" {
235
235
  * @param shareSessionWith provides reference on a previously created view's context to share session with
236
236
  * @returns promise created view's context
237
237
  */
238
- async createView( api: Api<BrowserAdapter, A, C>, shareSessionWith?: C ): Promise<C>;
238
+ async createView( api: Api<BrowserAdapter, C>, shareSessionWith?: C ): Promise<C>;
239
239
 
240
240
  /**
241
241
  * Destructs connection to browser by means of closing the controlled
@@ -254,17 +254,17 @@ declare module "@cepharum/contextual-gherkin" {
254
254
  /**
255
255
  * Provides assertions library for assessing state of elements.
256
256
  */
257
- async getAssertions(): Promise<() => A>;
257
+ async getAssertions(): Promise<() => Expect>;
258
258
  }
259
259
 
260
260
  /**
261
261
  * Implements adapter for using contextual-gherkin with Playwright.
262
262
  */
263
- class PlaywrightAdapter extends BrowserAdapter<Expect, PlaywrightContext> {
263
+ class PlaywrightAdapter extends BrowserAdapter<PlaywrightContext> {
264
264
  constructor( browser: PlaywrightBrowser, contextOptions?: PlaywrightBrowserContextOptions );
265
265
 
266
266
  /** @inheritDoc */
267
- async createView( api: Api<PlaywrightAdapter, Expect, PlaywrightContext>, shareSessionWith: PlaywrightContext = undefined ): Promise<PlaywrightContext>;
267
+ async createView( api: Api<PlaywrightAdapter, PlaywrightContext>, shareSessionWith: PlaywrightContext = undefined ): Promise<PlaywrightContext>;
268
268
  }
269
269
 
270
270
  /**
@@ -516,7 +516,7 @@ declare module "@cepharum/contextual-gherkin" {
516
516
  * Contexts can be tracked and recovered to implement follow-up queries and
517
517
  * actions.
518
518
  */
519
- abstract class AbstractContext<C = ABstractContext> {
519
+ abstract class AbstractContext<C = AbstractContext> {
520
520
  /**
521
521
  * @param framework names the framework this context is working with
522
522
  * @param source context this instance is starting as a duplicate of
@@ -978,8 +978,6 @@ declare module "@cepharum/contextual-gherkin" {
978
978
  uncheck(): Promise<void>;
979
979
  }
980
980
 
981
- type Assertions = Expect;
982
-
983
981
  class PlaywrightContext extends AbstractContext<PlaywrightContext> {
984
982
  /**
985
983
  * Provides the locator used to query a connected browser's page for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cepharum/contextual-gherkin",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "flexible step definitions for Gherkin",
5
5
  "author": "cepharum GmbH <thomas.urban@cepharum.de>",
6
6
  "homepage": "https://cepharum-foss.gitlab.io/contextual-gherkin/",