feature-login

Below is common-login which describes the feature and mappings.

 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
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**

.. toctree::
   :maxdepth: 2

   feature-login
   pageobject-login
   help-test-tutorial-login
   help-test-tutorial-login-debug

The above test is run using the following command with the following output.

.. literalinclude:: common-login-termout.txt
  :language: bash
  :linenos:

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

.. image:: ../../screenshots/screen/bdd-login-test-user_document_Chrome_v63_1024x768.png

#. bdd-login-unknown-user_document_Chrome_v63_1024x768

.. image:: ../../screenshots/screen/bdd-login-unknown-user_document_Chrome_v63_1024x768.png

`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

.. _`youtube (17:21) drpfeature login common tests 2018 01 09 15 16 55`: https://youtu.be/OdpHsmyaVXg
.. _tc27: https://youtu.be/OdpHsmyaVXg?t=27
.. _tc73: https://youtu.be/OdpHsmyaVXg?t=73
.. _tc116: https://youtu.be/OdpHsmyaVXg?t=116
.. _tc187: https://youtu.be/OdpHsmyaVXg?t=187
.. _tc207: https://youtu.be/OdpHsmyaVXg?t=207
.. _tc307: https://youtu.be/OdpHsmyaVXg?t=307
.. _tc393: https://youtu.be/OdpHsmyaVXg?t=393
.. _tc580: https://youtu.be/OdpHsmyaVXg?t=580
.. _tc664: https://youtu.be/OdpHsmyaVXg?t=664
.. _tc741: https://youtu.be/OdpHsmyaVXg?t=741

.. raw:: html

    <div style="position: relative; padding-bottom: 5.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
    <iframe width="854" height="480" src="https://www.youtube.com/embed/OdpHsmyaVXg" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
    </div>

**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.

.. _common-login: http://drpfeature.readthedocs.io/en/latest/common-login.html
.. _feature-login: http://drpfeature.readthedocs.io/en/latest/feature-login.html
.. _pageobject-login: http://drpfeature.readthedocs.io/en/latest/pageobject-login.html
.. _help-test-tutorial-login: http://drpfeature.readthedocs.io/en/latest/help-test-tutorial-login.html

Below is the current login.feature file.

 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
Feature: RackN UX Portal Login Test
    As a RackN Community User
    I want to test the RackN-Portal login
    So I have confidence in the accessablity and security of the RackN-Portal

    Scenario: github-network-check
        Given I open the url "https://github.com/"
        Then  the title is "The world's leading software development platform · GitHub"


    Scenario: feature-drp-ux-check-install
        Given I am an anonymous user at the RackN-Portal
        When  I click the RackN-UX button "RackN Portal Login"
        Then  I expect the url to contain "amazoncognito.com"
        And   the title is "Signin"
##        When  I set "gobblygook@horseoff.com" to the inputfield "#username"
##        And   I set "BadPass" to the inputfield "#password"
        When  I attempt RackN-Login with username "gobblygook@horseoff.com" and password "BadPass"
#        And   I click the "Sign In" button
        Then  I expect that element "p#loginErrorMessage" becomes visible
        And   I expect that element "p#loginErrorMessage" does appear exactly "2" times
#        Then  I expect that element "p#loginErrorMessage" matches the text "User does not exist. "
        Then  I expect that RackN-UX element "//*[@id='loginErrorMessage']" matches the text "User does not exist."

    Scenario: feature-login-test-user
        Given I am an anonymous user at the RackN-Portal
        When  I click the RackN-UX button "RackN Portal Login"
        Then  I expect the url to contain "amazoncognito.com"
        And   the title is "Signin"
        When  I attempt RackN-Login with username "test@horseoff.com" and password "GoodUser1"
        Then  I expect that element "//*[@id='header']/div[2]/div/div/div[1]" becomes visible
        And   I expect that element "//*[@id='header']/div[2]/div/div/div[1]" does appear exactly "1" times
#        Then  I expect that element "p#loginErrorMessage" matches the text "User does not exist. "
        And   I pause for 5000ms
        Then  I wait on element "//*[@id='header']/div[2]/div/div/div[1]" for 5000ms to be visible
        Then  I expect that element "//*[@id='header']/div[2]/div/div/div[1]" matches the text "test@horseoff.com"

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
catmini:drpfeature msops$ yarn run wdio --spec ./src/features/login.feature 
yarn run v1.3.2
$ /Users/msops/Code/drpfeature/node_modules/.bin/wdio --spec ./src/features/login.feature
------------------------------------------------------------------
[chrome #0-0] Session ID: d8b93c17088c4f45ccc0a9c4f08943a6
[chrome #0-0] Spec: /Users/msops/Code/drpfeature/src/features/login.feature
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0] RackN UX Portal Login Test
[chrome #0-0]
[chrome #0-0]     WTF
[chrome #0-0]       ✓ I open the url "https://github.com/"
[chrome #0-0]       ✓ the title is "The world's leading software development platform · GitHub"
[chrome #0-0]
[chrome #0-0]     feature-login-unknown-user
[chrome #0-0]       ✓ I am an anonymous user at the RackN-Portal
[chrome #0-0]       ✓ I click the RackN-UX button "RackN Portal Login"
[chrome #0-0]       ✓ I expect the url to contain "amazoncognito.com"
[chrome #0-0]       ✓ the title is "Signin"
[chrome #0-0]       ✓ I attempt RackN-Login with username "gobblygook@horseoff.com" and password "BadPass"
[chrome #0-0]       ✓ I expect that element "p#loginErrorMessage" becomes visible
[chrome #0-0]       ✓ I expect that element "p#loginErrorMessage" does appear exactly "2" times
[chrome #0-0]       ✓ I expect that RackN-UX element "//*[@id='loginErrorMessage']" matches the text "User does not exist."
[chrome #0-0]
[chrome #0-0]     feature-login-test-user
[chrome #0-0]       ✓ I am an anonymous user at the RackN-Portal
[chrome #0-0]       ✓ I click the RackN-UX button "RackN Portal Login"
[chrome #0-0]       ✓ I expect the url to contain "amazoncognito.com"
[chrome #0-0]       ✓ the title is "Signin"
[chrome #0-0]       ✓ I attempt RackN-Login with username "test@horseoff.com" and password "GoodUser1"
[chrome #0-0]       ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" becomes visible
[chrome #0-0]       ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" does appear exactly "1" times
[chrome #0-0]       ✓ I pause for 5000ms
[chrome #0-0]       ✓ I wait on element "//*[@id='header']/div[2]/div/div/div[1]" for 5000ms to be visible
[chrome #0-0]       ✓ I expect that element "//*[@id='header']/div[2]/div/div/div[1]" matches the text "test@horseoff.com"
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 20 passing (18s)
[chrome #0-0]

✨  Done in 22.75s.
catmini:drpfeature msops$ date
Tue Jan  9 15:09:18 CST 2018
catmini:drpfeature msops$ 
catmini:drpfeature msops$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (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/common-login.rst
	modified:   docs/source/feature-login.rst
	modified:   docs/source/pageobject-login.rst
	modified:   src/features/login.feature
	modified:   src/steps/then.js
	modified:   src/support/action/racknUserLogin.js
	modified:   src/support/check/racknCheckEqualsText.js
	modified:   wdio.PageObjectTest.conf.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	docs/source/feature-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 - Working"
[master 540f28d] Issue 1 - Feature login - Working
 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

 9 files changed, 134 insertions(+), 36 deletions(-)
 create mode 100644 docs/source/feature-login-termout.txt
catmini:drpfeature msops$ 

Currently this test only checks https://github.com/ctrees/drpfeature html title. GitHub search and ‘fake login’ Scenarios are commented out.

WIP

WIP (Work In Progress) is in REVERSE order (oldest last) so #1 should be current.

  1. 2018-01-09 - Docs and screencast details of login feature problems and workflow
  2. 2018-01-09 - Basic login test working https://github.com/ctrees/drpfeature/commit/ddebd56fda05d0712059ca4b0d344a94769121a0
    This is the basic login test via webdriver to login a user. I created a test@horseoff.com email address to test with to get through the aws conig? OAuth like stuff. The major difficulty was just getting the tools up and going AND figureing out React. Could not find much css styling to hang selectors off of and still having issues. But for now… I’ll call it good enough and start logging issues.

TODO