Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Replace 'I should see "..." style "..." value "..."' Behat step in smart menus #363

Closed
abias opened this issue Aug 20, 2023 · 1 comment
Labels
test Something which targets automated tests (Behat, PHPUnit)

Comments

@abias
Copy link
Member

abias commented Aug 20, 2023

This is a follow-up issue to #300

The smart menu patch shipped with a new Behat test step I should see "..." style "..." value "..."

This step is just used once in a scenario on https://github.com/moodle-an-hochschulen/moodle-theme_boost_union/blob/f5d593275c6ec4e8d2e446e3f82a51823e2f6e87/tests/behat/theme_boost_union_menusettings_application.feature#L213C70-L213C73

According to my understanding, this step does more or less the same

/**
* Verify the card size height.
*
* @Given /^I should see "(?P<element>(?:[^"]|\\")*)" style "(?P<rule>(?:[^"]|\\")*)" value "(?P<value>(?:[^"]|\\")*)"$/
* @param string $selector
* @param string $rule
* @param string $value
*/
public function i_should_see_style_value($selector, $rule, $value) {
// The DOM and the JS should be all ready and loaded. Running without spinning
// as this is a widely used step and we can not spend time here trying to see
// a DOM node that is not always there (at the moment clean is not even the
// default theme...).
$navbuttonjs = "return (
Y.one('$selector') &&
Y.one('$selector').getComputedStyle('$rule') !== $value
)";
// Adding an extra click we need to show the 'Log in' link.
if (!$this->evaluate_script($navbuttonjs)) {
return false;
}
return true;
}
what the custom DOM element ... should have computed style ... ... step which exists in Boost Union already does.

It would be worthwhile to get rid of this duplicated step and just use one step for the same purpose.

@abias abias added feature Something which is a new feature or big improvement test Something which targets automated tests (Behat, PHPUnit) and removed feature Something which is a new feature or big improvement labels Aug 20, 2023
@abias abias changed the title Improvement: Replace 'I should see "..." style "..." value "..."' Behat step in smart menus Test: Replace 'I should see "..." style "..." value "..."' Behat step in smart menus Aug 27, 2023
prasanna-lmsace added a commit to bdecentgmbh/moodle-theme_boost_union that referenced this issue Dec 19, 2023
lucaboesch pushed a commit that referenced this issue Dec 20, 2023
abias pushed a commit that referenced this issue Jan 13, 2024
abias pushed a commit that referenced this issue Jan 13, 2024
abias pushed a commit that referenced this issue Jan 13, 2024
abias pushed a commit that referenced this issue Jan 14, 2024
abias pushed a commit that referenced this issue Jan 14, 2024
@abias
Copy link
Member Author

abias commented Feb 17, 2024

This was solved some time ago by #501

@abias abias closed this as completed Feb 17, 2024
@github-project-automation github-project-automation bot moved this to Ready for Release Test in Boost Union Planning Board Feb 17, 2024
@abias abias moved this from Ready for Release Test to CLOSED in Boost Union Planning Board Feb 17, 2024
detomon pushed a commit to detomon/moodle-theme_boost_union that referenced this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Something which targets automated tests (Behat, PHPUnit)
Projects
Status: CLOSED
Development

No branches or pull requests

1 participant