Module: Playwright::Test

Defined in:
lib/playwright/test.rb

Overview

this module is responsible for running playwright assertions and integrating with test frameworks.

Defined Under Namespace

Modules: Matchers Classes: Expect

Constant Summary collapse

ALL_ASSERTIONS =
PageAssertions.instance_methods(false) + LocatorAssertions.instance_methods(false)
@@expect_timeout =
nil

Class Method Summary collapse

Class Method Details

.expect_timeoutObject



7
8
9
# File 'lib/playwright/test.rb', line 7

def self.expect_timeout
  @@expect_timeout || 5000 # default timeout is 5000ms
end

.expect_timeout=(timeout) ⇒ Object



11
12
13
# File 'lib/playwright/test.rb', line 11

def self.expect_timeout=(timeout)
  @@expect_timeout = timeout
end

.with_timeout(expect_timeout, &block) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/playwright/test.rb', line 15

def self.with_timeout(expect_timeout, &block)
  old_timeout = @@expect_timeout
  @@expect_timeout = expect_timeout
  block.call
ensure
  @@expect_timeout = old_timeout
end