Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_base_profile
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_base_profile
Commits
0399150f
Commit
0399150f
authored
3 years ago
by
Liam Morland
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4635: Test dashboard dropbutton link display
parent
b681f706
No related branches found
No related tags found
2 merge requests
!433
ISTWCMS-6296 Create test for all event dates test cases
,
!155
ISTWCMS-4635: Test dashboard dropbutton link display
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/Functional/UwWcmsBasicTest.php
+21
-0
21 additions, 0 deletions
tests/src/Functional/UwWcmsBasicTest.php
with
21 additions
and
0 deletions
tests/src/Functional/UwWcmsBasicTest.php
+
21
−
0
View file @
0399150f
...
@@ -1414,6 +1414,17 @@ class UwWcmsBasicTest extends BrowserTestBase {
...
@@ -1414,6 +1414,17 @@ class UwWcmsBasicTest extends BrowserTestBase {
* Test default dashboard.
* Test default dashboard.
*/
*/
private
function
dashboardTest
()
{
private
function
dashboardTest
()
{
// Used by dropbutton test.
$layout_link_xpath
=
$this
->
buildXPathQuery
(
'//ul[@class=:class]/li/a[contains(@href, :href)]'
,
[
':class'
=>
'dropbutton'
,
':href'
=>
'/home/layout'
,
]);
$layout_link_no_access_roles
=
[
'uw_role_site_owner'
,
'uw_role_form_editor'
,
'uw_role_form_results_access'
,
];
// Anonymous user cannot view "Who's online" block in dashboard.
// Anonymous user cannot view "Who's online" block in dashboard.
if
(
$this
->
loggedInUser
)
{
if
(
$this
->
loggedInUser
)
{
$this
->
drupalLogout
();
$this
->
drupalLogout
();
...
@@ -1446,6 +1457,16 @@ class UwWcmsBasicTest extends BrowserTestBase {
...
@@ -1446,6 +1457,16 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this
->
assertSession
()
->
linkNotExists
(
'People'
);
$this
->
assertSession
()
->
linkNotExists
(
'People'
);
$this
->
assertSession
()
->
linkNotExists
(
'Reports'
);
$this
->
assertSession
()
->
linkNotExists
(
'Reports'
);
}
}
// Test that dropbuttons do not have links to which the user has no
// access.
$link_exists
=
(
bool
)
$this
->
xpath
(
$layout_link_xpath
);
if
(
in_array
(
$role
,
$layout_link_no_access_roles
))
{
$this
->
assertFalse
(
$link_exists
,
'No access to layout dropbutton.'
);
}
else
{
$this
->
assertTrue
(
$link_exists
,
'Has access to layout dropbutton.'
);
}
}
}
else
{
else
{
$this
->
assertSession
()
->
statusCodeEquals
(
403
);
$this
->
assertSession
()
->
statusCodeEquals
(
403
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment