From 6a2e714aa9feb2660691d2523b501e1904c1b06d Mon Sep 17 00:00:00 2001 From: Valery Yatsynovich Date: Mon, 12 Aug 2024 15:56:22 +0300 Subject: [PATCH] [plugin-web-app] Replace `elementName` locator with `name` locator (#5298) --- .../plugins/pages/plugin-web-app-playwright.adoc | 2 +- .../resources/steps/defaults/composite.steps | 16 ++++++++-------- .../integration/DynamicVariablesTests.story | 2 +- .../story/integration/ElementStepsTests.story | 14 +++++++------- .../resources/story/system/HealthCheck.story | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/modules/plugins/pages/plugin-web-app-playwright.adoc b/docs/modules/plugins/pages/plugin-web-app-playwright.adoc index 5612a387c0..f936ff48c1 100644 --- a/docs/modules/plugins/pages/plugin-web-app-playwright.adoc +++ b/docs/modules/plugins/pages/plugin-web-app-playwright.adoc @@ -143,7 +143,7 @@ By. prefix is optional. |`name` |Locate elements where any attribute or text value matches the specified search value. This locator is translated to `xpath(.//\*[@*='' or text()=''])` locator. -|elementName(OK) +|name(OK) |=== diff --git a/vividus-plugin-web-app/src/main/resources/steps/defaults/composite.steps b/vividus-plugin-web-app/src/main/resources/steps/defaults/composite.steps index 6caac8c184..4c34fa5489 100644 --- a/vividus-plugin-web-app/src/main/resources/steps/defaults/composite.steps +++ b/vividus-plugin-web-app/src/main/resources/steps/defaults/composite.steps @@ -20,25 +20,25 @@ When I execute sequence of actions: Composite: Then an element with the name '$elementName' containing text '$text' exists Priority: 1 -Then number of elements found by `elementName()->filter.textPart()` is equal to `1` +Then number of elements found by `name()->filter.textPart()` is equal to `1` Composite: Then an element with the name '$elementName' and text '$text' exists -Then number of elements found by `elementName()->filter.caseSensitiveText()` is equal to `1` +Then number of elements found by `name()->filter.caseSensitiveText()` is equal to `1` Composite: Then a [$state] element with the name '$elementName' and text '$text' exists Priority: 1 -!-- DEPRECATED: 0.7.0, Then number of elements found by `elementName(%2$s)->filter.caseSensitiveText(%3$s).state(%1$s)` is equal to `1` -Then number of elements found by `elementName()->filter.caseSensitiveText().state()` is equal to `1` +!-- DEPRECATED: 0.7.0, Then number of elements found by `name(%2$s)->filter.caseSensitiveText(%3$s).state(%1$s)` is equal to `1` +Then number of elements found by `name()->filter.caseSensitiveText().state()` is equal to `1` Composite: Then an element with the name '$elementName' exists -Then number of elements found by `elementName()` is equal to `1` +Then number of elements found by `name()` is equal to `1` Composite: Then an element with the name '$elementName' does not exist -Then number of elements found by `elementName()` is equal to `0` +Then number of elements found by `name()` is equal to `0` Composite: Then a [$state] element with the name '$elementName' exists -!-- DEPRECATED: 0.7.0, Then number of elements found by `elementName(%2$s)->filter.state(%1$s)` is equal to `1` -Then number of elements found by `elementName()->filter.state()` is equal to `1` +!-- DEPRECATED: 0.7.0, Then number of elements found by `name(%2$s)->filter.state(%1$s)` is equal to `1` +Then number of elements found by `name()->filter.state()` is equal to `1` Composite: Then an element with the tag '$elementTag' and text '$text' exists Then number of elements found by `tagName()->filter.caseSensitiveText()` is equal to `1` diff --git a/vividus-tests/src/main/resources/story/integration/DynamicVariablesTests.story b/vividus-tests/src/main/resources/story/integration/DynamicVariablesTests.story index 63e4250307..ad57d694ae 100644 --- a/vividus-tests/src/main/resources/story/integration/DynamicVariablesTests.story +++ b/vividus-tests/src/main/resources/story/integration/DynamicVariablesTests.story @@ -38,5 +38,5 @@ Then `${browser-window-width}` is = `600` Scenario: Verify `context-source-code` dynamic variable When I reset context Then `${context-source-code}` matches `^.+` -When I change context to element located by `elementName(vividus-logo)` +When I change context to element located by `name(vividus-logo)` Then `${context-source-code}` matches `^