2.0.0 • Published 7 days ago

@lcrespilho/playwright-fixtures v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
7 days ago

PubSub

Kind: global class

new PubSub()

Utilizes the Observer Pattern, where the Page is the producer and the Node Playwright Test is the consumer. Every time the Page produces a message (window.dataLayer.push, or GA-Universal/GA4 network request), the consumer's subscribers callbacks are called.

pubSub.subscribe(subscriber)

Subscribe for messages. Used by the consumer.

Kind: instance method of PubSub

ParamTypeDescription
subscriberfunctioncallback function to be executed once the message arrives

pubSub.unsubscribe(subscriber)

Unsubscribe from messages. Used by the consumer.

Kind: instance method of PubSub

ParamTypeDescription
subscriberfunctionreference to a callback function previously subscribed

pubSub.publish(message)

Publish messages. Used by the producer.

Kind: instance method of PubSub

ParamTypeDescription
messageMessagemessage published.

pubSub.waitForMessage(config) ⇒ Promise.<Message>

Returns a promise that will be resolved when a message matching WaitForMessageOptions is found, or rejected if WaitForMessageOptions.timeout is reached. Used by the consumer.

Kind: instance method of PubSub
Returns: Promise.<Message> - message published.

ParamType
configWaitForMessageOptions

How to publish to npm registry

https://www.youtube.com/watch?v=Nh9xW2-ZOEU

2.0.0

7 days ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago