Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
cce00b6b
Commit
cce00b6b
authored
Dec 08, 2020
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3184632
by longwave: Convert assertions involving use of xpath on submit inputs to WebAssert
(cherry picked from commit
e0c8ce15
)
parent
a5a13278
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
16 deletions
+7
-16
core/modules/node/tests/src/Functional/AssertButtonsTrait.php
.../modules/node/tests/src/Functional/AssertButtonsTrait.php
+2
-6
core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
...sts/Installer/DistributionProfileTranslationQueryTest.php
+1
-2
core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
...nalTests/Installer/DistributionProfileTranslationTest.php
+1
-2
core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
...ctionalTests/Installer/InstallerLanguageDirectionTest.php
+1
-2
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
...nctionalTests/Installer/InstallerTranslationQueryTest.php
+1
-2
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
...al/FunctionalTests/Installer/InstallerTranslationTest.php
+1
-2
No files found.
core/modules/node/tests/src/Functional/AssertButtonsTrait.php
View file @
cce00b6b
...
...
@@ -16,10 +16,6 @@ trait AssertButtonsTrait {
* Whether to check if the buttons are in a dropbutton widget or not.
*/
public
function
assertButtons
(
array
$buttons
,
$dropbutton
=
TRUE
)
{
// Try to find a Save button.
$save_button
=
$this
->
xpath
(
'//input[@type="submit"][@value="Save"]'
);
// Verify that the number of buttons passed as parameters is
// available in the dropbutton widget.
if
(
$dropbutton
)
{
...
...
@@ -27,7 +23,7 @@ public function assertButtons(array $buttons, $dropbutton = TRUE) {
$count
=
count
(
$buttons
);
// Assert there is no save button.
$this
->
assert
True
(
empty
(
$save_button
)
);
$this
->
assert
Session
()
->
buttonNotExists
(
'Save'
);
// Dropbutton elements.
/** @var \Behat\Mink\Element\NodeElement[] $elements */
...
...
@@ -41,7 +37,7 @@ public function assertButtons(array $buttons, $dropbutton = TRUE) {
}
else
{
// Assert there is a save button.
$this
->
assert
True
(
!
empty
(
$save_button
)
);
$this
->
assert
Session
()
->
buttonExists
(
'Save'
);
$this
->
assertNoRaw
(
'dropbutton-wrapper'
);
}
}
...
...
core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
View file @
cce00b6b
...
...
@@ -89,8 +89,7 @@ protected function setUpProfile() {
protected
function
setUpSettings
()
{
// The language should have been automatically detected, all following
// screens should be translated already.
$elements
=
$this
->
xpath
(
'//input[@type="submit"]/@value'
);
$this
->
assertEqual
(
current
(
$elements
)
->
getText
(),
'Save and continue de'
);
$this
->
assertSession
()
->
buttonExists
(
'Save and continue de'
);
$this
->
translations
[
'Save and continue'
]
=
'Save and continue de'
;
// Check the language direction.
...
...
core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
View file @
cce00b6b
...
...
@@ -80,8 +80,7 @@ protected function setUpProfile() {
protected
function
setUpSettings
()
{
// The language should have been automatically detected, all following
// screens should be translated already.
$elements
=
$this
->
xpath
(
'//input[@type="submit"]/@value'
);
$this
->
assertEqual
(
current
(
$elements
)
->
getText
(),
'Save and continue de'
);
$this
->
assertSession
()
->
buttonExists
(
'Save and continue de'
);
$this
->
translations
[
'Save and continue'
]
=
'Save and continue de'
;
// Check the language direction.
...
...
core/tests/Drupal/FunctionalTests/Installer/InstallerLanguageDirectionTest.php
View file @
cce00b6b
...
...
@@ -32,8 +32,7 @@ protected function setUpLanguage() {
parent
::
setUpLanguage
();
// After selecting a different language than English, all following screens
// should be translated already.
$elements
=
$this
->
xpath
(
'//input[@type="submit"]/@value'
);
$this
->
assertEqual
(
current
(
$elements
)
->
getText
(),
'Save and continue Arabic'
);
$this
->
assertSession
()
->
buttonExists
(
'Save and continue Arabic'
);
$this
->
translations
[
'Save and continue'
]
=
'Save and continue Arabic'
;
// Verify that language direction is right-to-left.
...
...
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
View file @
cce00b6b
...
...
@@ -37,8 +37,7 @@ protected function visitInstaller() {
// The language should have been automatically detected, all following
// screens should be translated already.
$elements
=
$this
->
xpath
(
'//input[@type="submit"]/@value'
);
$this
->
assertEqual
(
current
(
$elements
)
->
getText
(),
'Save and continue de'
);
$this
->
assertSession
()
->
buttonExists
(
'Save and continue de'
);
$this
->
translations
[
'Save and continue'
]
=
'Save and continue de'
;
// Check the language direction.
...
...
core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
View file @
cce00b6b
...
...
@@ -36,8 +36,7 @@ protected function setUpLanguage() {
// After selecting a different language than English, all following screens
// should be translated already.
$elements
=
$this
->
xpath
(
'//input[@type="submit"]/@value'
);
$this
->
assertEqual
(
current
(
$elements
)
->
getText
(),
'Save and continue de'
);
$this
->
assertSession
()
->
buttonExists
(
'Save and continue de'
);
$this
->
translations
[
'Save and continue'
]
=
'Save and continue de'
;
// Check the language direction.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment