feature-drpux-check-install¶
- Intent
- This feature is used to verify a fresh isolated install of drp on the local system through the drp-ux.
- Success
- Passing and Failing test that verify a fresh install via the drp-ux after
Check the iso list¶
Current
Purpose | drpcli | drp-api | drp-ux page url | drp-ux list (now) ________________________________________ |
---|---|---|---|---|
list of iso | drpcli iso list | https://<endpointIP>/api/v3/isos | #/e/<endpointIP>/isos | <table class=”ui sortable very basic very compact table”> |
Suggested
Purpose | drpcli | drp-api | drp-ux page url | drp-ux list (suggest)___ _____ |
---|---|---|---|---|
list iso | drpcli iso list | https://<endpointIP>/api/v3/isos | #/e/<endpointIP>/isos | <table data-rackn-api=”iso-list”> |
So a community user can do the following
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Feature: RackN UX Portal Fresh Install Check Test
As a RackN Community User
I want to test to check a drp fresh install through RackN-Portal UX
So I have confidence in the installation and can learn the RackN-Portal UX layout
Scenario: list-iso
Given I am running the drp-provision endpoint with url <drp-provision-endpoint-ip>
And I open the RackN-Portal <RackN-Portal-Page> page
Then I should see a list of my <RackN-Portal-Page> that contains <User-eXpected-iso-name>
Examples:
| drp-provision-endpoint | RackN-Portal-Page | User-eXpected-iso-name |
| https://192.168.1.200:8092 | isos | CentOS-7-x86_64-Minimal-1708.iso |
| https://192.168.1.200:8092 | isos | sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar |
| https://192.168.1.200:8092 | isos | ubuntu-16.04.3-server-amd64.iso |
|
So a css dev can do the following
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Feature: RackN UX Portal Fresh Install Check Test
As a RackN CSS Web Designer
I want to test css effects through RackN-Portal UX
So I have confidence that the user sees the desired RackN-Portal UX effect
Scenario: list-iso
Given I am running the drp-provision endpoint with url <drp-provision-endpoint-ip>
And I open the RackN-Portal <RackN-Portal-Page> page
Then I should see <element> with an attribute <RackN-CSS-data> containing value <value>
Examples:
| drp-provision-endpoint | RackN-Portal-Page | element | RackN-CSS-data | value |
| https://192.168.1.200:8092 | isos | table | data-rackn-api | iso-list |
| https://192.168.1.200:8092 | isos | td | data-rackn-api | iso-list-item |
| https://192.168.1.200:8092 | isos | td | data-iso-list-item | CentOS-7-x86_64-Minimal-1708.iso |
|
So an api dev can do the following
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Feature: RackN UX Portal Fresh Install Check Test
As a RackN api Designer
I want to test rest api call
So I have confidence the UX guys will leave me alone
Scenario: list-iso
Given I am running the drp-provision endpoint with url <drp-provision-endpoint-ip>
When I issue the following commad
"""
curl -k -u rocketskates:r0cketsk8ts -X GET https://localhost:8092/api/v3/isos -H "Content-Type: application/json"
"""
Then I should get the following responce
"""
["CentOS-7-x86_64-Minimal-1708.iso","sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar","ubuntu-16.04.3-server-amd64.iso"]
"""
|
So a cli dev can do the following
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 | Feature: RackN UX Portal Fresh Install Check Test
As a RackN api Designer
I want to test rest api call
So I have confidence the UX guys will leave me alone
Scenario: list-iso
Given I am running the drp-provision endpoint from the local diretory
When I issue the following commad
"""
./drpcli isos list
"""
Then I should get the following responce
"""
[
"CentOS-7-x86_64-Minimal-1708.iso",
"sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar",
"ubuntu-16.04.3-server-amd64.iso"
]
"""
Scenario: list-iso-files
Given I am running the drp-provision endpoint from the local diretory
When I issue the following commad
"""
tree drp-data/tftpboot/isos
"""
Then I should get the following responce
"""
drp-data/tftpboot/isos
├── CentOS-7-x86_64-Minimal-1708.iso
├── sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar
└── ubuntu-16.04.3-server-amd64.iso
0 directories, 3 files
"""
|
It really is not practical keeping all the above ‘in-sync’ but English Language Text is really the only ‘common’. If you create mappings for the other testing levels you COULD just keep them in a yaml or json blob for CI sync.
From a UX prospective you can rackn-tag these elements into what-ever-tag-strategy you choose. But you end up with some sort of inheritance strategy (I use pageobject). This can be used by a theme strategy, il8n, accessablity and TEST… which is my point. THIS COULD be passed in by the JSON blob your already using, which is why I am pushing cause basically you’ve got all the structural stuff to do it.
Breaking down the current UX I see 3 view panels
- userBar - The top bar of the current UX (tied to current user auth)
- navBar - pageobject-navbar The side bar of the current UX (tied to current endpoint)
- viewPage - pageobject-login The displayed info (yes I know… it can be blah blah aka dashboard)
Which is why I started creating those page object. BUT when I created navBar I thought it was general nav… really pageobject-navbar is pageobject-user and pageobject-navbar better named as pageobject-endpoint. All this naming is actually important and should support the documentation, which is why I like the idea of the mappings to check that naming.
I don’t think it’s worth breaking down the pageobjects into what I would suggest until we talk… figure out if this is worth the effort or not.
Testing Links
- https://github.com/ctrees/drpfeature
- https://192.168.1.200:8092
- https://rackn.github.io/provision-ux/#/e/192.168.1.200:8092/isos
- https://192.168.1.200:8092/swagger-ui/#!/Isos/listIsos
drp-api via curl:
catmini:drpisolated msops$ curl -k -u rocketskates:r0cketsk8ts -X GET https://localhost:8092/api/v3/isos -H "Content-Type: application/json"
["CentOS-7-x86_64-Minimal-1708.iso","sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar","ubuntu-16.04.3-server-amd64.iso"]catmini:drpisolated msops$
Quick Start Install and Run
- Get the quickstart drp-provision enpoint running locally
- Load the isos via command line it suggests
- Clone the repo https://github.com/ctrees/drpfeature.git (Follow the README.md)
- yarn install
- yarn run wip
- The “yarn run wip” should run just the drpux-iso.feature right now but you should see chrome fire up and poke stuff
Below is the current drpux-iso.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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | Feature: RackN UX Portal Fresh Install Check Test
As a RackN Community User
I want to test to check a drp fresh install through RackN-Portal UX
So I have confidence in the installation and can learn the RackN-Portal UX layout
Scenario: github-repo-network-check
Given I open the url "https://github.com/ctrees/drpfeature"
Then I expect that the url is "https://github.com/ctrees/drpfeature"
And I expect that the title is "GitHub - ctrees/drpfeature: Digital Rebar Provision UX Feature Testing Automation"
Scenario: feature-login-unknown-user
Given I am running the drp-provision endpoint with url "https://192.168.1.200:8092"
And I open the url "https://rackn.github.io/provision-ux/#/e/192.168.1.200:8092/isos"
# When I click the RackN-UX button "RackN Portal Login"
# Then I expect the url to contain "amazoncognito.com"
Then the title is "RackN"
# And I pause for 3000ms
When I set "rocketskates" to REACTjs inputfield "input[name=username]"
And I set "r0cketsk8ts" to REACTjs inputfield "input[name=password]"
And I pause for 60000ms
# When I set "rocketskates" to REACTjs inputfield "//input[@name='username']"
# And I set "r0cketsk8ts" to REACTjs inputfield "//input[@name='password']"
# When I attempt RackN-Login with username "rocketskates" and password "r0cketsk8ts"
# And I click the RackN-UX button "Login"
#prehackreverse And I click the RackN-UX button "button[type=submit]"
And I click on the button "button[type=submit]"
And I pause for 2000ms
Then I expect that element "#root > div > div:nth-child(3) > div > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td:nth-child(2)" becomes visible
# And I expect that element "#root > div > div:nth-child(3) > div > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td:nth-child(2)" does appear exactly "2" times
# Then I expect that element "p#loginErrorMessage" matches the text "User does not exist. "
And I pause for 1000ms
Then I expect that RackN-UX REACTjs index "0" of element "td:nth-child(2)" matches the text "CentOS-7-x86_64-Minimal-1708.iso"
And I pause for 1000ms
Then I expect that RackN-UX REACTjs index "1" of element "td:nth-child(2)" matches the text "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar"
And I pause for 1000ms
Then I expect that RackN-UX REACTjs index "2" of element "td:nth-child(2)" matches the text "ubuntu-16.04.3-server-amd64.iso"
And I pause for 3000ms
# Then I expect that RackN-UX element "td:nth-child(2)" matches the text "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar"
# Then I expect that RackN-UX element "td:nth-child(2)" matches the text "ubuntu-16.04.3-server-amd64.iso"
# And I pause for 2000ms
#Examples:
# | drp-provisionIP | drpux-page-iso |
# | https://192.168.1.200:8092 | https://rackn.github.io/provision-ux/#/e/192.168.1.200:8092/isos |
# @Pending
# 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 | catmini:drpfeature msops$ yarn run wdio --spec ./src/features/drpux.feature
or
catmini:drpfeature msops$ yarn run wip
yarn run v1.3.2
$ yarn run wdio --spec ./src/features/drpux-iso.feature
$ /Users/msops/Code/drpfeature/node_modules/.bin/wdio --spec ./src/features/drpux-iso.feature
------------------------------------------------------------------
[chrome #0-0] Session ID: 6faf1f316261baa40b29704c9ee0332c
[chrome #0-0] Spec: /Users/msops/Code/drpfeature/src/features/drpux-iso.feature
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0] RackN UX Portal Fresh Install Check Test
[chrome #0-0]
[chrome #0-0] github-repo-network-check
[chrome #0-0] ✓ I open the url "https://github.com/ctrees/drpfeature"
[chrome #0-0] ✓ I expect that the url is "https://github.com/ctrees/drpfeature"
[chrome #0-0] ✓ I expect that the title is "GitHub - ctrees/drpfeature: Digital Rebar Provision UX Feature Testing Automation"
[chrome #0-0]
[chrome #0-0] feature-login-unknown-user
[chrome #0-0] ✓ I am running the drp-provision endpoint with url "https://192.168.1.200:8092"
[chrome #0-0] ✓ I open the url "https://rackn.github.io/provision-ux/#/e/192.168.1.200:8092/isos"
[chrome #0-0] ✓ the title is "RackN"
[chrome #0-0] ✓ I set "rocketskates" to REACTjs inputfield "input[name=username]"
[chrome #0-0] ✓ I set "r0cketsk8ts" to REACTjs inputfield "input[name=password]"
[chrome #0-0] ✓ I click the RackN-UX button "button[type=submit]"
[chrome #0-0] ✓ I expect that element "#root > div > div:nth-child(3) > div > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div > table > tbody > tr:nth-child(1) > td:nth-child(2)" becomes visible
[chrome #0-0] ✓ I expect that RackN-UX REACTjs index "0" of element "td:nth-child(2)" matches the text "CentOS-7-x86_64-Minimal-1708.iso"
[chrome #0-0] ✓ I expect that RackN-UX REACTjs index "1" of element "td:nth-child(2)" matches the text "sledgehammer-f5ffd3ed10ba403ffff40c3621f1e31ada0c7e15.tar"
[chrome #0-0] ✓ I expect that RackN-UX REACTjs index "2" of element "td:nth-child(2)" matches the text "ubuntu-16.04.3-server-amd64.iso"
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 13 passing (7s)
[chrome #0-0]
✨ Done in 11.63s.
catmini:drpfeature msops$
|
The below is the last gitcommit
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 | catmini:drpfeature msops$ touch docs/source/feature-drpux-check-install-gitcommit.txt
catmini:drpfeature msops$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
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: .gitignore
modified: docs/source/features.rst
modified: docs/source/index.rst
modified: package.json
modified: src/features/login.feature
modified: src/steps/given.js
modified: src/steps/then.js
modified: src/steps/when.js
modified: src/support/action/racknClickElement.js
Untracked files:
(use "git add <file>..." to include in what will be committed)
docs/source/feature-drpux-check-install-gitcommit.txt
docs/source/feature-drpux-check-install-termout.txt
docs/source/feature-drpux-check-install.rst
docs/source/help-test-drpisolated.rst
src/features/drpux-iso.feature
src/support/action/racknSetReactInputField.js
src/support/check/racknReactCheckEqualsText.js
no changes added to commit (use "git add" and/or "git commit -a")
catmini:drpfeature msops$ git add *
The following paths are ignored by one of your .gitignore files:
drpisolated
errorShots
node_modules
screenshots
Use -f if you really want to add them.
catmini:drpfeature msops$ git commit -m "Issue#5 - feature-drpux-check-install"
[master 5cd0aca] Issue#5 - feature-drpux-check-install
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
15 files changed, 536 insertions(+), 4 deletions(-)
create mode 100644 docs/source/feature-drpux-check-install-gitcommit.txt
create mode 100644 docs/source/feature-drpux-check-install-termout.txt
create mode 100644 docs/source/feature-drpux-check-install.rst
create mode 100644 docs/source/help-test-drpisolated.rst
create mode 100644 src/features/drpux-iso.feature
create mode 100644 src/support/action/racknSetReactInputField.js
create mode 100644 src/support/check/racknReactCheckEqualsText.js
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: .gitignore
modified: docs/source/feature-drpux-check-install-gitcommit.txt
no changes added to commit (use "git add" and/or "git commit -a")
catmini:drpfeature msops$ git push
Counting objects: 25, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (25/25), done.
Writing objects: 100% (25/25), 8.93 KiB | 2.23 MiB/s, done.
Total 25 (delta 14), reused 0 (delta 0)
remote: Resolving deltas: 100% (14/14), completed with 14 local objects.
To https://github.com/ctrees/drpfeature.git
2e8b690..5cd0aca master -> master
catmini:drpfeature msops$
|
WIP¶
WIP (Work In Progress) is in REVERSE order (oldest last) so #1 should be current.
- Update Document and commit
- DONE - 2018-01-11 - Get basic test working for community demo
- DONE - 2018-01-10 - Created drpfeature Issue#5 https://github.com/ctrees/drpfeature/issues/5
TODO¶
- Document ReactJS and CSS selector issues
- Screencast of working ?
- Screencast of debugging ?
- Verify more pageobjects
- Define the pageobjects with the community (so I don’t have to re-do)
- Get Examples Table working
Reference Links
- https://github.com/ctrees/drpfeature/
- http://drpfeature.readthedocs.io/en/latest/feature-drpux-check-install.html
- file:///Users/msops/Code/drpfeature/docs/build/html/feature-drpux-check-install.html
- http://drpfeature.readthedocs.io/en/latest/help-test-drpisolated.html
- file:///Users/msops/Code/drpfeature/docs/build/html/help-test-drpisolated.html
- http://provision.readthedocs.io/en/tip/doc/quickstart.html
- https://github.com/ctrees/drpfeature/issues/5
- http://provision.readthedocs.io/en/tip/doc/cli_commands.html#rs-cli-command
- http://provision.readthedocs.io/en/latest/doc/Swagger.html
- http://provision.readthedocs.io/en/tip/doc/cli/drpcli_subnets_list.html
- https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child
- https://www.w3schools.com/cssref/css_selectors.asp
- http://webdriver.io/guide/usage/selectors.html#Accessibility-ID
- https://cucumber.io/docs/reference#doc-strings
Screencasts¶
- Show that the drp-provision local endpoint is running.
- tc52 Start the test with “yarn run wip” which should ONLY run the drpux-iso.feature test
- tc69 Local endpoint Login
- tc71 Test checking isos are loaded
- tc80 Test of drpux-iso.feature passes 18 checks (17s)
- tc88 Start the full test with “yarn test”
- Chris talks through stuff… probably can’t follow line of thinking cause I’m talking to myself mostly…
- tc181 Test finishes up and THE END babble..