-
+
HTML
page.get_by_role("button").click
diff --git a/documentation/docs/api/locator_assertions.md b/documentation/docs/api/locator_assertions.md
index 03b8c90c..ac5032bb 100644
--- a/documentation/docs/api/locator_assertions.md
+++ b/documentation/docs/api/locator_assertions.md
@@ -19,7 +19,7 @@ Since the matcher comes with auto-waiting feature, we don't have to describe tri
```ruby
page.content = <<~HTML
Pending
-
+
HTML
page.get_by_role("button").click
diff --git a/lib/playwright/locator_assertions_impl.rb b/lib/playwright/locator_assertions_impl.rb
index 787f35de..b7dcbb22 100644
--- a/lib/playwright/locator_assertions_impl.rb
+++ b/lib/playwright/locator_assertions_impl.rb
@@ -423,7 +423,6 @@ def to_have_text(expected, ignoreCase: nil, timeout: nil, useInnerText: nil)
if expected.respond_to?(:each)
expected_text = to_expected_text_values(
expected,
- match_substring: true,
normalize_white_space: true,
ignore_case: ignoreCase,
)
@@ -441,7 +440,6 @@ def to_have_text(expected, ignoreCase: nil, timeout: nil, useInnerText: nil)
else
expected_text = to_expected_text_values(
[expected],
- match_substring: true,
normalize_white_space: true,
ignore_case: ignoreCase,
)
diff --git a/spec/integration/assertions_spec.rb b/spec/integration/assertions_spec.rb
index 848fc183..d9bf44a5 100644
--- a/spec/integration/assertions_spec.rb
+++ b/spec/integration/assertions_spec.rb
@@ -585,6 +585,23 @@ def setup_page(page, aria_invalid_value)
end
end
+ it "should not match a substring" do
+ with_page do |page|
+ page.goto(server_empty_page)
+ page.set_content("