Problem/Motivation
Currently the module still contains some web tests provided by the simpletest module.
Proposed resolution
Convert web tests to Functional tests.
Currently the module still contains some web tests provided by the simpletest module.
Convert web tests to Functional tests.
Comments
Comment #2
jeroentComment #3
jeroentComment #5
jeroentComment #6
jeroentComment #8
jeroentThe FunctionalJavascript test is currently failing. Hard to debug when the tests pass locally...
Comment #9
jeroentComment #11
jeroentComment #13
jeroentComment #14
jeroentComment #16
jeroentComment #17
jeroentComment #18
jeroentComment #20
jeroentComment #21
jeroentComment #22
jeroentComment #23
aohrvetpv commentedI can try later to see if your patch works for me locally.
Once I had a test failure on Drupal.org that I couldn't reproduce locally. After very many patch attempts I figured out it was a timing issue, where two things happened faster on Drupal.org, such that locally they happened with a different timestamp (a different second), but on Drupal.org they happened with the same timestamp (in the same second).
I doubt it is the same issue here but thought I'd mention it just in case. Maybe different browser versions with this issue? It looked like these tests are using some specific version of Chrome.
Thanks for doing this tests conversion, it is a big contribution.
Comment #24
jeroent@AohRveTPV, turns out on my machine the tests only work with chromedriver 74...
Comment #25
jeroentAllright, this test should pass. Most of the tests were pretty straight forward to convert, but the PasswordHistoryTests is a complete rewrite.
Comment #26
aohrvetpv commentedThanks, this is great.
#25 seems to combine (1) converting away from SimpleTest, and (2) making formatting improvements (e.g. converting to single quotes for consistency). I think it might be clearer to break into separate patches. I can split it later.
The History constraint behavior ought to be changed per #2867320: Password Policy History module wrong behaviour, in my opinion. The test logic will probably need to be adjusted for that, so I'm not going to review it too closely for now.
Comment #27
aohrvetpv commentedComment #28
aohrvetpv commentedCommitted a change to convert all double quotes in string literals of tests to single quotes.
Updated the patch accordingly, and removed a couple formatting improvements that were unrelated to this conversion. Doing so makes it easier to see in the patch/commit precisely which changes were made to convert to PHPUnit tests. (I'm apparently not the only one who thinks this is a good idea--see #7 under "Extended instructions for converting a DrupalWebTestCase test" at https://www.drupal.org/docs/8/testing/converting-d7-simpletests-to-drupal-8)
Comment #29
aohrvetpv commentedGendered language on password_policy_history/tests/src/FunctionalJavascript/PasswordHistoryTest.php:128.
Comment #30
aohrvetpv commented- Removed gendered language.
- Corrected incorrect article "an" to "a".
- Changed
drupalget()todrupalGet()for consistency. (Unsure how that's working in all lowercase.)Comment #32
aohrvetpv commentedThanks Jereon.
Comment #33
rosinegrean commented