mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-23 21:41:44 +02:00
Add e2e tests for role based content of the about page
This commit is contained in:
parent
0199ef9e21
commit
70313995b9
@ -52,10 +52,10 @@
|
|||||||
{{ $t('commons.environment') }}
|
{{ $t('commons.environment') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="about-debug box is-family-monospace is-size-7">
|
<div class="about-debug box is-family-monospace is-size-7">
|
||||||
<button :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listInfos.innerText" v-clipboard:success="clipboardSuccessHandler">
|
<button id="btnCopyEnvVars" :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listInfos.innerText" v-clipboard:success="clipboardSuccessHandler">
|
||||||
<font-awesome-icon :icon="['fas', 'copy']" />
|
<font-awesome-icon :icon="['fas', 'copy']" />
|
||||||
</button>
|
</button>
|
||||||
<ul ref="listInfos">
|
<ul ref="listInfos" id="listInfos">
|
||||||
<li v-for="(value, key) in infos" :value="value" :key="key"><b>{{key}}</b>: {{value}}</li>
|
<li v-for="(value, key) in infos" :value="value" :key="key"><b>{{key}}</b>: {{value}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -63,10 +63,10 @@
|
|||||||
{{ $t('settings.admin_settings') }}
|
{{ $t('settings.admin_settings') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div v-if="showAdminSettings" class="about-debug box is-family-monospace is-size-7">
|
<div v-if="showAdminSettings" class="about-debug box is-family-monospace is-size-7">
|
||||||
<button :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listAdminSettings.innerText" v-clipboard:success="clipboardSuccessHandler">
|
<button id="btnCopyAdminSettings" :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listAdminSettings.innerText" v-clipboard:success="clipboardSuccessHandler">
|
||||||
<font-awesome-icon :icon="['fas', 'copy']" />
|
<font-awesome-icon :icon="['fas', 'copy']" />
|
||||||
</button>
|
</button>
|
||||||
<ul ref="listAdminSettings">
|
<ul ref="listAdminSettings" id="listAdminSettings">
|
||||||
<li v-for="(value, setting) in adminSettings" :value="value" :key="setting"><b>{{setting}}</b>: {{value}}</li>
|
<li v-for="(value, setting) in adminSettings" :value="value" :key="setting"><b>{{setting}}</b>: {{value}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -74,10 +74,10 @@
|
|||||||
{{ $t('settings.user_preferences') }}
|
{{ $t('settings.user_preferences') }}
|
||||||
</h2>
|
</h2>
|
||||||
<div v-if="showUserPreferences" class="about-debug box is-family-monospace is-size-7">
|
<div v-if="showUserPreferences" class="about-debug box is-family-monospace is-size-7">
|
||||||
<button :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listUserPreferences.innerText" v-clipboard:success="clipboardSuccessHandler">
|
<button id="btnCopyUserPreferences" :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" v-clipboard="() => this.$refs.listUserPreferences.innerText" v-clipboard:success="clipboardSuccessHandler">
|
||||||
<font-awesome-icon :icon="['fas', 'copy']" />
|
<font-awesome-icon :icon="['fas', 'copy']" />
|
||||||
</button>
|
</button>
|
||||||
<ul ref="listUserPreferences">
|
<ul ref="listUserPreferences" id="listUserPreferences">
|
||||||
<li v-for="(value, preference) in userPreferences" :value="value" :key="preference"><b>{{preference}}</b>: {{value}}</li>
|
<li v-for="(value, preference) in userPreferences" :value="value" :key="preference"><b>{{preference}}</b>: {{value}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -86,6 +86,7 @@
|
|||||||
<!-- close button -->
|
<!-- close button -->
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<router-link
|
<router-link
|
||||||
|
id="lnkBack"
|
||||||
:to="{ path: $route.params.goBackTo, params: { returnTo: $route.params.returnTo, toRefresh: true } }"
|
:to="{ path: $route.params.goBackTo, params: { returnTo: $route.params.returnTo, toRefresh: true } }"
|
||||||
:aria-label="$t('commons.close_the_x_page', {pagetitle: pagetitle})"
|
:aria-label="$t('commons.close_the_x_page', {pagetitle: pagetitle})"
|
||||||
class="button is-rounded"
|
class="button is-rounded"
|
||||||
|
@ -3,9 +3,11 @@ Documentation A page object to use in About page tests.
|
|||||||
...
|
...
|
||||||
Library SeleniumLibrary
|
Library SeleniumLibrary
|
||||||
Resource ../common.resource
|
Resource ../common.resource
|
||||||
|
Library String
|
||||||
|
|
||||||
*** Variables ***
|
*** Variables ***
|
||||||
${ABOUT PAGE URL} ${ROOT URL}/about
|
${ABOUT PAGE URL} ${ROOT URL}/about
|
||||||
|
${BACK BUTTON} lnkBack
|
||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
About Page Should Be Open
|
About Page Should Be Open
|
||||||
@ -13,3 +15,40 @@ About Page Should Be Open
|
|||||||
|
|
||||||
Go To About Page
|
Go To About Page
|
||||||
Go To ${ABOUT PAGE URL}
|
Go To ${ABOUT PAGE URL}
|
||||||
|
|
||||||
|
Block Vars Should Be Visible
|
||||||
|
[Arguments] ${elementId}
|
||||||
|
Wait Until Page Contains Element id:${elementId}
|
||||||
|
${COUNT} = Get Element Count css:#${elementId} li
|
||||||
|
Should Be True 0 < ${COUNT}
|
||||||
|
|
||||||
|
Environment Vars Should Be Visible
|
||||||
|
Block Vars Should Be Visible listInfos
|
||||||
|
|
||||||
|
User Preferences Should Be Visible
|
||||||
|
Block Vars Should Be Visible listUserPreferences
|
||||||
|
|
||||||
|
User Preferences Should Not Be Visible
|
||||||
|
Page Should Not Contain id:listUserPreferences
|
||||||
|
|
||||||
|
Admin Settings Should Be Visible
|
||||||
|
Block Vars Should Be Visible listAdminSettings
|
||||||
|
|
||||||
|
Admin Settings Should Not Be Visible
|
||||||
|
Page Should Not Contain id:listAdminSettings
|
||||||
|
|
||||||
|
Block Vars Should Have A Value
|
||||||
|
[Arguments] ${elementId}
|
||||||
|
Wait Until Page Contains Element id:${elementId}
|
||||||
|
${elements} = Get WebElements css:#${elementId} li
|
||||||
|
FOR ${element} IN @{elements}
|
||||||
|
${text} = Get Text ${element}
|
||||||
|
@{values} = Split String ${text} :
|
||||||
|
Should Not Be Empty ${values}[1]
|
||||||
|
END
|
||||||
|
|
||||||
|
Copying Block Vars Should Notify On Success
|
||||||
|
[Arguments] ${button}
|
||||||
|
Click Button ${button}
|
||||||
|
A Success Notification Should Appear
|
||||||
|
Click Element ${SUCCESS NOTIFICATION}
|
@ -0,0 +1,26 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Documentation A test suite containing tests related to the about page static content.
|
||||||
|
Suite Setup Run Keywords
|
||||||
|
... Open Custom Browser
|
||||||
|
... AND Play Admin Sign In Workflow
|
||||||
|
... AND Go To About Page
|
||||||
|
... AND Set Footer As Static
|
||||||
|
Suite Teardown Close All Browsers
|
||||||
|
Resource ../../Pages/about_page.robot
|
||||||
|
Resource ../../common.resource
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Environment Vars Should Be Visible To Admin
|
||||||
|
Environment Vars Should Be Visible
|
||||||
|
|
||||||
|
User Preferences Should Be Visible To Admin
|
||||||
|
User Preferences Should Be Visible
|
||||||
|
|
||||||
|
Admin Settings Should Be Visible To Admin
|
||||||
|
Admin Settings Should Be Visible
|
||||||
|
|
||||||
|
Admin Settings Should Have A Value
|
||||||
|
Block Vars Should Have A Value listAdminSettings
|
||||||
|
|
||||||
|
Copying Admin Settings Should Notify On Success
|
||||||
|
Copying Block Vars Should Notify On Success btnCopyAdminSettings
|
@ -0,0 +1,26 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Documentation A test suite containing tests related to the about page static content.
|
||||||
|
Suite Setup Run Keywords
|
||||||
|
... Open Custom Browser
|
||||||
|
... AND Play Logout Workflow
|
||||||
|
... AND Go To About Page
|
||||||
|
... AND Set Footer As Static
|
||||||
|
Suite Teardown Close All Browsers
|
||||||
|
Resource ../../Pages/about_page.robot
|
||||||
|
Resource ../../common.resource
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Environment Vars Should Be Visible To Anonymous
|
||||||
|
Environment Vars Should Be Visible
|
||||||
|
|
||||||
|
Environment Vars Should Have A Value
|
||||||
|
Block Vars Should Have A Value listInfos
|
||||||
|
|
||||||
|
Copying Env Vars Should Notify On Success
|
||||||
|
Copying Block Vars Should Notify On Success btnCopyEnvVars
|
||||||
|
|
||||||
|
User Preferences Should Not Be Visible To Anonymous
|
||||||
|
User Preferences Should Not Be Visible
|
||||||
|
|
||||||
|
Admin Settings Should Not Be Visible To Anonymous
|
||||||
|
Admin Settings Should Not Be Visible
|
@ -0,0 +1,27 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Documentation A test suite containing tests related to the about page static content.
|
||||||
|
Suite Setup Run Keywords
|
||||||
|
... Open Custom Browser
|
||||||
|
... AND Play User Sign In Workflow
|
||||||
|
... AND Go To About Page
|
||||||
|
... AND Set Footer As Static
|
||||||
|
Suite Teardown Close All Browsers
|
||||||
|
Resource ../../Pages/about_page.robot
|
||||||
|
Resource ../../common.resource
|
||||||
|
Library String
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Environment Vars Should Be Visible To User
|
||||||
|
Environment Vars Should Be Visible
|
||||||
|
|
||||||
|
User Preferences Should Be Visible To User
|
||||||
|
User Preferences Should Be Visible
|
||||||
|
|
||||||
|
User Preferences Should Have A Value
|
||||||
|
Block Vars Should Have A Value listUserPreferences
|
||||||
|
|
||||||
|
Copying User Preferences Should Notify On Success
|
||||||
|
Copying Block Vars Should Notify On Success btnCopyUserPreferences
|
||||||
|
|
||||||
|
Admin Settings Should Not Be Visible
|
||||||
|
Page Should Not Contain id:listAdminSettings
|
@ -16,6 +16,9 @@ ${PASSWORD} password
|
|||||||
${ROOT URL} http://${SERVER}
|
${ROOT URL} http://${SERVER}
|
||||||
${LOGOUT LINK} lnkSignOut
|
${LOGOUT LINK} lnkSignOut
|
||||||
|
|
||||||
|
${SUCCESS NOTIFICATION} css:#vueNotification .is-success
|
||||||
|
${ALERT NOTIFICATION} css:#vueNotification .is-danger
|
||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
Open Custom Browser
|
Open Custom Browser
|
||||||
[Arguments] ${url}=${ROOT URL}
|
[Arguments] ${url}=${ROOT URL}
|
||||||
@ -39,10 +42,10 @@ Go Authenticated To
|
|||||||
Wait Until Location Is ${url}
|
Wait Until Location Is ${url}
|
||||||
|
|
||||||
A Success Notification Should Appear
|
A Success Notification Should Appear
|
||||||
Wait Until Element Is Visible css:#vueNotification .is-success
|
Wait Until Element Is Visible ${SUCCESS NOTIFICATION}
|
||||||
|
|
||||||
An Error Notification Should Appear
|
An Error Notification Should Appear
|
||||||
Wait Until Element Is Visible css:#vueNotification .is-danger
|
Wait Until Element Is Visible ${ALERT NOTIFICATION}
|
||||||
|
|
||||||
Field Should Show An Error
|
Field Should Show An Error
|
||||||
[Arguments] ${field error}
|
[Arguments] ${field error}
|
||||||
@ -50,7 +53,7 @@ Field Should Show An Error
|
|||||||
Should Not Be Empty ${field error}
|
Should Not Be Empty ${field error}
|
||||||
|
|
||||||
Scroll To Bottom
|
Scroll To Bottom
|
||||||
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|
Execute Javascript window.scrollTo(0,document.body.scrollHeight)
|
||||||
|
|
||||||
Element Should Have Class
|
Element Should Have Class
|
||||||
[Arguments] ${element} ${className}
|
[Arguments] ${element} ${className}
|
||||||
@ -61,3 +64,7 @@ Element Should Not Have Class
|
|||||||
[Arguments] ${element} ${className}
|
[Arguments] ${element} ${className}
|
||||||
${class}= Get Element Attribute ${element} class
|
${class}= Get Element Attribute ${element} class
|
||||||
Should Not Contain ${class} ${className}
|
Should Not Contain ${class} ${className}
|
||||||
|
|
||||||
|
Set Footer As Static
|
||||||
|
execute javascript
|
||||||
|
... document.querySelector('footer').style = 'position: static';
|
Loading…
x
Reference in New Issue
Block a user