- Issue created by @cosmicdreams
- Assigned to cosmicdreams
- πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
In the comments here we can have a discussion of WHAT needs to be tested.
- πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
I have made process in writing tests, I had a heck of time getting my test runner working with my debugger. After that was done I wrote this:
/** * Test node edit form with new same_page_preview. */ public function testNodePreviewButtons() { // Prerequisites. $assert_session = $this->assertSession(); $page = $this->getSession()->getPage(); // Does standard preview button? try { $assert_session->assert($page->hasButton('Preview'), "Has Preview button."); } catch (ExpectationException $e) { $this->fail('Original Preview button not found.'); } // Does the page have our new preview buttons? try { $assert_session->assert($page->hasLink('edit-toggle-preview'), "Has Toggle Preview button."); $assert_session->assert($page->hasButton('edit-preview--2'), "Has Refresh Preview button."); $page->clickLink('edit-toggle-preview'); } catch (ExpectationException | ElementNotFoundException $e ) { $this->fail('New Preview buttons not found.'); } }
- πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
It produced these pages:
Node Add Page
Preview Pane
@brianperry @laurii
I was expected the Node Add Page to show the toggle working. Are javascript driven behaviors possible to test with FunctionalTest? Should I use FunctionalJavascript or Nightwatch instead? Is there something else you'd recommend? - Status changed to RTBC
almost 2 years ago 8:07pm 14 March 2023 - πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
I have test that work now.
- @cosmicdreams opened merge request.
- πΊπΈUnited States cosmicdreams Minneapolis/St. Paul
Ultimately I couldn't get a Nightwatch test that installs a module to work (either the core provided test or one I created myself). I found a way to test everything with a FunctionalJavascript tests so I'll put a pin in this until I know more.
- Status changed to Fixed
almost 2 years ago 10:04pm 14 March 2023 - Status changed to Fixed
almost 2 years ago 10:49pm 17 March 2023