common-login¶
- Intent
- This login is used to access UX elements in the RackN portal login process and to preform automated UX login testing.
- Success
- Passing and Failing test that can detect successful and failed RackN UX portal user login.
- Related Information
- feature help location: docs/source/feature-login.rst
- feature file location: src/features/login.features
- pageobject help location: (this file) docs/source/pageobject-login.rst
- spec test file location: src/spec/login.spec.js
- pageobject file location: src/pageojects/login.page.js
- visual result file 1: screenshots/screen/login-<testname1>_document_Chrome_v63_1024x768.png
- visual result file 2: screenshots/screen/login-<testname2>_document_Chrome_v63_1024x768.png
Related Links
The above test is run using the following command with the following output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | catmini:drpfeature msops$ yarn test
yarn run v1.3.2
$ yarn run test:features; yarn run test:po
$ wdio wdio.conf.js; wdio_ret=$?; forever stopall; exit $wdio_ret
------------------------------------------------------------------
[chrome #0-14] Session ID: dfa9645ba3f043712560582f334365db
[chrome #0-14] Spec: /Users/msops/Code/drpfeature/src/features/githubSearch.feature
[chrome #0-14] Running: chrome
[chrome #0-14]
[chrome #0-14] drpfeature repo chech at Github
[chrome #0-14]
[chrome #0-14] open-URL
[chrome #0-14] ✓ I open the url "https://github.com/ctrees/drpfeature"
[chrome #0-14] ✓ I expect that the url is "https://github.com/ctrees/drpfeature"
[chrome #0-14] ✓ I expect that the title is "GitHub - ctrees/drpfeature: Digital Rebar Provision UX Feature Testing Automation"
[chrome #0-14]
[chrome #0-14]
[chrome #0-14] 3 passing (7s)
[chrome #0-14]
------------------------------------------------------------------
[chrome #0-18] Session ID: 3044202b8940ccd186ffc4e303137755
[chrome #0-18] Spec: /Users/msops/Code/drpfeature/src/features/login.feature
[chrome #0-18] Running: chrome
[chrome #0-18]
[chrome #0-18] RackN UX Portal Login Test
[chrome #0-18]
[chrome #0-18] WTF
[chrome #0-18] ✓ I open the url "https://github.com/"
[chrome #0-18] ✓ the title is "The world's leading software development platform · GitHub"
[chrome #0-18]
[chrome #0-18] feature-login-unknown-user
[chrome #0-18] ✓ I am an anonymous user at the RackN-Portal
[chrome #0-18] ✓ I click the RackN-UX button "RackN Portal Login"
[chrome #0-18] ✓ I expect the url to contain "amazoncognito.com"
[chrome #0-18] ✓ the title is "Signin"
[chrome #0-18] ✓ I attempt RackN-Login with username "gobblygook@horseoff.com" and password "BadPass"
[chrome #0-18] ✓ I expect that element "p#loginErrorMessage" becomes visible
[chrome #0-18] ✓ I expect that element "p#loginErrorMessage" does appear exactly "2" times
[chrome #0-18] ✓ I expect that RackN-UX element "//*[@id='loginErrorMessage']" matches the text "User does not exist."
[chrome #0-18]
[chrome #0-18] feature-login-test-user
[chrome #0-18] ✓ I am an anonymous user at the RackN-Portal
[chrome #0-18] ✓ I click the RackN-UX button "RackN Portal Login"
[chrome #0-18] ✓ I expect the url to contain "amazoncognito.com"
[chrome #0-18] ✓ the title is "Signin"
[chrome #0-18] ✓ I attempt RackN-Login with username "test@horseoff.com" and password "GoodUser1"
[chrome #0-18] ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" becomes visible
[chrome #0-18] ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" does appear exactly "1" times
[chrome #0-18] ✓ I pause for 5000ms
[chrome #0-18] ✓ I wait on element "//*[@id='header']/div[2]/div/div/div[1]" for 5000ms to be visible
[chrome #0-18] ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" matches the text "test@horseoff.com"
[chrome #0-18]
[chrome #0-18]
[chrome #0-18] 20 passing (33s)
[chrome #0-18]
==================================================================
Number of specs: 31
23 passing (60.60s)
info: No forever processes running
$ DEBUG=false yarn run wdio wdio.PageObjectTest.conf.js
$ /Users/msops/Code/drpfeature/node_modules/.bin/wdio wdio.PageObjectTest.conf.js
------------------------------------------------------------------
[chrome #0-0] Session ID: b2a3e975568f35da2bd0f32b7e394e97
[chrome #0-0] Spec: /Users/msops/Code/drpfeature/src/pospecs/login.spec.js
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0] drp-ux auth form
[chrome #0-0] ✓ bdd-login-unknown-user
[chrome #0-0] ✓ bdd-login-test-user
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 2 passing (17s)
[chrome #0-0]
✨ Done in 85.01s.
catmini:drpfeature msops$ date
Tue Jan 9 15:29:56 CST 2018
catmini:drpfeature msops$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: docs/source/feature-login-termout.txt
modified: src/pospecs/login.spec.js
modified: wdio.PageObjectTest.conf.js
Untracked files:
(use "git add <file>..." to include in what will be committed)
docs/source/common-login-termout.txt
no changes added to commit (use "git add" and/or "git commit -a")
catmini:drpfeature msops$
catmini:drpfeature msops$ git add *
The following paths are ignored by one of your .gitignore files:
errorShots
node_modules
screenshots
Use -f if you really want to add them.
catmini:drpfeature msops$ git commit -m "Issue 1 - Feature Login - Common Test update"
[master ddebd56] Issue 1 - Feature Login - Common Test update
Committer: Mail Services Operations <msops@catmini.cat9.private>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
4 files changed, 168 insertions(+), 1 deletion(-)
create mode 100644 docs/source/common-login-termout.txt
catmini:drpfeature msops$ yarn docs
yarn run v1.3.2
$ cd docs && make html && cd ..
Running Sphinx v1.6.5
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 4 changed, 0 removed
reading sources... [100%] pageobject-login
/Users/msops/Code/drpfeature/docs/source/help-test-tutorial-login.rst:: WARNING: image file not readable: ../../screenshots/screen/should-deny-access-with-wrong-creds_document_Chrome_v63_1024x768.png
/Users/msops/Code/drpfeature/docs/source/help-test-tutorial-login.rst:: WARNING: image file not readable: ../../screenshots/screen/should-allow-access-with-correct-creds_document_Chrome_v63_1024x768.png
/Users/msops/Code/drpfeature/docs/source/pageobject-login.rst:42: WARNING: image file not readable: ../../screenshots/screen/should-deny-access-with-wrong-creds_document_Chrome_v63_1024x768.png
/Users/msops/Code/drpfeature/docs/source/pageobject-login.rst:46: WARNING: image file not readable: ../../screenshots/screen/should-allow-access-with-correct-creds_document_Chrome_v63_1024x768.png
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] pageobjects
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 4 warnings.
Build finished. The HTML pages are in build/html.
✨ Done in 2.45s.
catmini:drpfeature msops$
|
If you do not see the images, you need to run the test locally and rebuild the docs (see above).
- bdd-login-test-user_document_Chrome_v63_1024x768
- bdd-login-unknown-user_document_Chrome_v63_1024x768
youtube (17:21) drpfeature login common tests 2018 01 09 15 16 55
tc27 Show local of http://drpfeature.readthedocs.io/en/latest/feature-login.html
tc73 Run login.feature test ONLY to verify it is passing:
yarn run wdio --spec ./src/features/login.features
tc116 Run ALL the tests to verify I didn’t break other tests (which I did):
yarn run test
tc116 WOOPS… I left ‘verbose’ on in the wdio.PageObjectTest.conf.js
tc207 WE FOUND an ERROR… yup login.spec.js
tc307 Begin tracing down Error in login.spec.js
tc393 THE FIX - move code that I had in the loginPage.open call into login.spec.js
tc580 Seemed to work… run again to check
tc664 OK… it’s working… so NOW lets update the docs and commit the changes.
tc741 Create common-login-termout.txt to dump the results to the document.
next
- Related - Read The Docs - Links
- common-login Common resources for login feature
- feature-login Documentation for login feature
- pageobject-login Documentation for login pageobject
- help-test-tutorial-login Tutorial on developing, debuging and using login testing.