Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
org.etsi.osl.tmf.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
OSL
code
org.etsi.osl.tmf.web
Commits
354c9046
Commit
354c9046
authored
1 month ago
by
tzanmix
Browse files
Options
Downloads
Patches
Plain Diff
fixed-config
parent
7d2e373e
No related branches found
Branches containing commit
No related tags found
1 merge request
!22
Draft: Resolve "Implement user journey tests"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cypress.config.ts
+2
-0
2 additions, 0 deletions
cypress.config.ts
cypress/e2e/user-journeys-logged-in.cy.ts
+41
-0
41 additions, 0 deletions
cypress/e2e/user-journeys-logged-in.cy.ts
cypress/e2e/user-journeys.cy.ts
+39
-17
39 additions, 17 deletions
cypress/e2e/user-journeys.cy.ts
with
82 additions
and
17 deletions
cypress.config.ts
+
2
−
0
View file @
354c9046
...
...
@@ -5,5 +5,7 @@ export default defineConfig({
setupNodeEvents
(
on
,
config
)
{
// implement node event listeners here
},
baseUrl
:
"
http://localhost:4200/
"
,
pageLoadTimeout
:
80000
},
});
This diff is collapsed.
Click to expand it.
cypress/e2e/user-journeys-logged-in.cy.ts
0 → 100644
+
41
−
0
View file @
354c9046
describe
(
'
logged user journeys
'
,
()
=>
{
//sign user in before each test
beforeEach
(()
=>
{
cy
.
visit
(
"
http://localhost:4200/
"
);
//sign in journey through services portal
});
it
(
'
logs in through services
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .container > .row > :nth-child(2) > a > .btn
'
).
click
();
//cy.get(':nth-child(1) > .nav-link').click()
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/services
"
);
// cy.get('.btn').should("contain", "Sign In").click();
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
cy
.
get
(
'
#username
'
).
type
(
'
admin
'
);
cy
.
get
(
'
#password
'
).
type
(
'
openslice
'
);
cy
.
get
(
'
#kc-login
'
).
click
();
});
//redirect page
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/redirect
"
);
//back on services marketplace after login
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/services/services_marketplace
"
);
cy
.
get
(
'
:nth-child(2) > #navbarDropdown
'
).
each
((
$link
)
=>
{
const
url
=
$link
.
prop
(
'
href
'
);
console
.
log
(
url
);
if
(
url
)
{
cy
.
request
(
url
).
then
((
response
)
=>
{
expect
(
response
.
status
).
to
.
eq
(
200
);
// Ensure link is not broken
});
}
cy
.
wrap
(
$link
).
click
();
// Click the link
cy
.
url
().
should
(
'
eq
'
,
url
);
// Ensure navigation happened correctly
cy
.
go
(
'
back
'
);
// Navigate back to check the next link
});
});
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
cypress/e2e/user-journeys.cy.ts
+
39
−
17
View file @
354c9046
const
baseUrl
=
Cypress
.
config
(
'
baseUrl
'
);
describe
(
'
user journey
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
visit
(
'
http://localhost:4200/
'
);
cy
.
visit
(
baseUrl
);
})
context
(
'
user-not-logged-in
'
,
()
=>
{
context
.
skip
(
'
user-not-logged-in
'
,
()
=>
{
it
(
'
checks services portal
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .container > .row > :nth-child(2) > a > .btn
'
).
click
();
//cy.get(':nth-child(1) > .nav-link').click()
...
...
@@ -99,14 +101,13 @@ describe('user journey', () => {
});
});
//infinite loop
// it.only('checks linkedin link', () => {
// cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(1)').click();
// cy.origin('https://www.linkedin.com/company/openslice/', ()=> {
// cy.location("pathname").should("equal", "/");
// });
// });
it
.
only
(
'
checks slack link
'
,
()
=>
{
it
(
'
checks linkedin link
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .ng-star-inserted > :nth-child(1)
'
).
click
();
cy
.
origin
(
'
https://www.linkedin.com/company/openslice
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/company/openslice
"
);
});
});
it
(
'
checks slack link
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .ng-star-inserted > :nth-child(2)
'
).
click
();
cy
.
origin
(
'
https://openslice.slack.com/
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/
"
);
...
...
@@ -114,12 +115,33 @@ describe('user journey', () => {
});
});
//twitter test cannot pass, depends on user login
// it.only('checks twitter link', () => {
// cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(3)').click();
// cy.origin('https://x.com/OpensliceOSS', () => {
// cy.location("pathname").should("equal", '/')
// });
// });
it
(
'
checks twitter link
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .ng-star-inserted > :nth-child(3)
'
).
click
();
cy
.
origin
(
'
https://x.com/OpensliceOSS
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
satisfy
"
,
(
url
)
=>
{
return
url
===
'
/OpensliceOSS
'
||
url
===
'
/i/flow/login
'
;
})
});
});
it
(
'
checks ecosystem link
'
,
()
=>
{
cy
.
get
(
'
.col-md-10 > :nth-child(1) > a
'
).
click
();
cy
.
origin
(
'
https://osl.etsi.org/ecosystem/
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/ecosystem/
"
);
});
});
//never loads, timeout
it
.
skip
(
'
opens terms and conditions
'
,
()
=>
{
cy
.
get
(
'
[href="https://osl.etsi.org/files/SDG_OSL_Terms_and_Conditions.pdf"]
'
).
click
();
// cy.origin('https://osl.etsi.org/files/SDG_OSL_Terms_and_Conditions.pdf/', () => {
// cy.location("pathname").should("equal", "/files/SDG_OSL_Terms_and_Conditions.pdf/")
// })
})
it
(
'
checks osl etsi link
'
,
()
=>
{
cy
.
get
(
'
[target="_blank"]
'
).
click
();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/
"
)
})
});
...
...
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