- Issue created by @eduardo morales alberti
- 🇨🇭Switzerland yobottehg Basel
In addition to the regressions above in rc-14 the "preview" button is always displayed on the create page even if the preview is disabled for that entity type.
- 🇧🇪Belgium dtfabio Ninove
Hi yobottehg,
After updating gin to rc-14 on Drupal version 10.2.8, I also had the problem that the preview buttons were shown even if they were disabled, MR 531 from the following ticket solved this problem for me:
Cannot opt out buttons using #gin_action_item = TRUE 🐛 Cannot opt out buttons using #gin_action_item = TRUE Active
Hope this will fix it for you as well.
Greetings,
Fabio
- 🇩🇪Germany jurgenhaas Gottmadingen
The preview button issue is out of scope of this issue. But as @dtfabio already mentioned, that's fixed. His linked issue 🐛 Cannot opt out buttons using #gin_action_item = TRUE Active has been merged into 3.x-dev and there is also work going on in 📌 Improve sticky actions implementation Active which I recommend applying for further testing.
When it comes to the original topic of this issue, this is not necessarily a regression. It's a change in the markup of the action buttons that automatic testing needs to adjust to. We've had such changes in Cypress changes as well.
For the background:
The buttons are still present, but hidden in the form. What the user sees instead are the labels in the sticky top bar. However, the automatic tests in Behat, Cypress or other platforms, doesn't care about the visuals, they look into the markup and realize that the buttons are there but hidden. That gets them to assume that they are not clickable.
In Cypress, this can be resolved by enforcing the submit instruction. That way, Cypress ignores the fact that the button is hidden.
Not sure, what's the equivalent for that in Behat, but there should certainly be one. @eduardo morales alberti is there a way you could find out and let us know? I know, it's unfortunate that you have to update your tests, but these sticky action buttons can only be implemented that way, so we have to ask everyone to update their tests in that context.
- 🇪🇸Spain eduardo morales alberti Spain, 🇪🇺
Thank you @jurgenhaas
We updated the tests using the following custom steps on Behat.
/** * @Given I press the submit input */ public function iPressTheButtonInput() { $session = $this->getSession(); $driver = $session->getDriver(); if ($driver instanceof \Behat\Mink\Driver\Selenium2Driver) { // JavaScript-enabled submission. $session->executeScript('document.querySelector("input#edit-submit").click();'); } else { $session->getPage()->pressButton('edit-submit'); } }
- 🇨🇭Switzerland saschaeggi Zurich
@eduardo can you check if 📌 Improve sticky actions implementation Active would fix your behat tests? If yes, can you provide feedback in that issue? Thanks!