Last active
April 18, 2017 04:37
-
-
Save Roadmaster/f3e214f26a3218dd65d9cdd6f8d67c51 to your computer and use it in GitHub Desktop.
A codeceptjs test (acceptance test). This creates a user in login.ubuntu.com (assumes a development instance with no captcha protection)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature('Create an account'); | |
ac_num = Math.floor(Math.random() * 1e10); | |
var the_mail = "user" + ac_num + "@example.com"; | |
Scenario('test some forms', (I) => { | |
I.amOnPage("/"); | |
I.see("One account"); | |
I.dontSee("Strength:") | |
I.dontSee("Please tell us your name and choose a password"); | |
I.checkOption('form[data-qa-id="login_form"] #id_new_user'); | |
I.see("Please tell us your name and choose a password"); | |
within('form[data-qa-id="create_account_form"]', function() { | |
I.checkOption('#id_accept_tos'); | |
I.fillField( '#id_email', the_mail); | |
I.fillField( '#id_displayname', 'my name'); | |
I.fillField( '#id_password', 'p1i2z3z4a'); | |
I.fillField( '#id_passwordconfirm', 'p1i2z3z4a'); | |
}); | |
I.see("Strength:"); | |
I.click("button[data-qa-id='register_button']"); | |
I.see('account was created successfully'); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What if there is a google captcha in it's login?