2.0.0 • Published 1 year ago

@lcrespilho/playwright-fixtures v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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

1 year ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago