The Behat test for login assumes that the system has an account "admin" with the username "admin." This is not likely to be true for any system other than one spun up by Travis. Instead, the test should generate a user with a random username and password, log them in for the test, and then destroy the user afterward.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | user-for-login-test-2299157-2.patch | 1.41 KB | cboyden |
Comments
Comment #1
dsnopekAh, yes, I agree this is a bug, but not because it insecure (it's just a test!) but because it's a hidden dependency outside of panopoly_test and the tests themselves.
Comment #2
cboyden commentedHere's a patch that uses the Drupal extension's "Given users:" step to create a test user and use them for the scenario. I would prefer to use the random generator, but I was not able to get it to work in this context.
The Drupal Extension does not document the fact that you can set a password using this step. Their example table only includes the name, mail, and roles fields. If there is no pass field, it creates a random password.
Comment #4
dsnopekThanks! :-) Rerolled for the move to panopoly_test and committed. Worked locally, but let's see what Travis-CI says:
https://travis-ci.org/panopoly/panopoly/builds/29916966