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
b679c623
Commit
b679c623
authored
1 month ago
by
tzanmix
Browse files
Options
Downloads
Patches
Plain Diff
group-by-custom-commands
parent
354c9046
No related branches found
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
+6
-1
6 additions, 1 deletion
cypress.config.ts
cypress/e2e/user-journeys.cy.ts
+33
-64
33 additions, 64 deletions
cypress/e2e/user-journeys.cy.ts
cypress/support/commands.ts
+79
-10
79 additions, 10 deletions
cypress/support/commands.ts
with
118 additions
and
75 deletions
cypress.config.ts
+
6
−
1
View file @
b679c623
import
{
inject
}
from
"
@angular/core
"
;
import
{
defineConfig
}
from
"
cypress
"
;
import
{
defineConfig
}
from
"
cypress
"
;
import
{
AppService
}
from
"
src/app/shared/services/app.service
"
;
//let appConfig = inject(AppService);
export
default
defineConfig
({
export
default
defineConfig
({
e2e
:
{
e2e
:
{
setupNodeEvents
(
on
,
config
)
{
setupNodeEvents
(
on
,
config
)
{
// implement node event listeners here
// implement node event listeners here
},
},
baseUrl
:
"
http://localhost:4200/
"
,
baseUrl
:
"
http://localhost:4200/
"
,
pageLoadTimeout
:
80000
},
},
});
});
This diff is collapsed.
Click to expand it.
cypress/e2e/user-journeys.cy.ts
+
33
−
64
View file @
b679c623
...
@@ -6,80 +6,49 @@ describe('user journey', () => {
...
@@ -6,80 +6,49 @@ describe('user journey', () => {
cy
.
visit
(
baseUrl
);
cy
.
visit
(
baseUrl
);
})
})
context
.
skip
(
'
user-not-logged-in
'
,
()
=>
{
context
(
'
user-not-logged-in
'
,
()
=>
{
it
(
'
checks services portal
'
,
()
=>
{
it
(
'
checks services portal
'
,
()
=>
{
cy
.
get
(
'
:nth-child(2) > .container > .row > :nth-child(2) > a > .btn
'
).
click
();
cy
.
navigateToServices
(
'
:nth-child(2) > .container > .row > :nth-child(2) > a > .btn
'
);
//cy.get(':nth-child(1) > .nav-link').click()
});
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/services
"
);
it
(
'
checks services portal via image
'
,
()
=>
{
cy
.
get
(
'
.btn
'
).
should
(
"
contain
"
,
"
Sign In
"
);
cy
.
navigateToServices
(
'
:nth-child(2) > .container > .row > .text-left
'
);
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
should
(
"
exist
"
);
});
it
(
'
checks services portal via anchor
'
,
()
=>
{
//service marketplace button should exist and should redirect to /services_marketplace
cy
.
navigateToServices
(
'
:nth-child(1) > .nav-link
'
);
cy
.
get
(
'
.mr-auto > .nav-item > .nav-link
'
).
click
();
cy
.
get
(
'
.jumbotron > h5.ng-tns-c147-1
'
).
should
(
"
contain
"
,
"
Browse available services and sign in to order
"
);
cy
.
get
(
'
.catalog-tree-header
'
).
should
(
"
exist
"
);
//sign in button should exist
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
click
();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
});
});
it
(
'
checks resources portal
'
,
()
=>
{
it
(
'
checks resources portal
'
,
()
=>
{
cy
.
get
(
'
:nth-child(3) > .container > .row > .order-md-1 > a > .btn
'
).
click
();
//cy.get(':nth-child(2) > .nav-link').click();
//cy.get(':nth-child(2) > .nav-link').click();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/resources
"
);
cy
.
navigateToResources
(
'
:nth-child(3) > .container > .row > .order-md-1 > a > .btn
'
);
//sign in button should exist
cy
.
get
(
'
.btn
'
).
should
(
'
exist
'
).
click
();
//cy.get('nav-link').should('exist').click();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
});
});
it
(
'
checks testing portal
'
,
()
=>
{
it
(
'
checks resources portal via image
'
,
()
=>
{
cy
.
get
(
'
:nth-child(5) > .container > .row > .order-md-1 > a > .btn
'
).
click
();
cy
.
navigateToResources
(
'
:nth-child(3) > .container > .row > .order-md-2 > a > .img-fluid
'
);
//cy.get(':nth-child(2) > .nav-link').click();
})
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/testing
"
);
it
(
'
checks resources portal via anchor
'
,
()
=>
{
//sign in button should exist
cy
.
navigateToResources
(
'
:nth-child(2) > .nav-link
'
);
cy
.
get
(
'
.btn
'
).
should
(
'
exist
'
).
click
();
//cy.get('nav-link').should('exist').click();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
});
});
it
(
'
checks products portal
'
,
()
=>
{
cy
.
get
(
'
:nth-child(6) > .container > .row > :nth-child(2) > a > .btn
'
).
click
();
//cy.get(':nth-child(1) > .nav-link').click()
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/products
"
);
cy
.
get
(
'
.btn
'
).
should
(
"
contain
"
,
"
Sign In
"
);
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
should
(
"
exist
"
);
//marketplace button should exist and should redirect to products/marketplace
it
(
'
checks testing portal
'
,
()
=>
{
cy
.
get
(
'
.mr-auto > .nav-item > .nav-link
'
).
click
();
cy
.
navigateToTesting
(
'
:nth-child(5) > .container > .row > .order-md-1 > a > .btn
'
);
cy
.
get
(
'
.catalog-tree-header
'
).
should
(
"
exist
"
);
});
cy
.
get
(
'
.mb-0
'
).
should
(
"
contain
"
,
"
Product Catalog Explorer
"
);
it
(
'
checks testing via image
'
,
()
=>
{
cy
.
navigateToTesting
(
'
:nth-child(5) > .container > .row > .order-md-2 > a > .img-fluid
'
);
//sign in button should exist
})
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
click
();
it
(
'
checks testing portal via anchor
'
,
()
=>
{
cy
.
navigateToTesting
(
'
:nth-child(4) > .nav-link
'
)
//sign in button should redirect to auth form
});
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
it
(
'
checks products portal
'
,
()
=>
{
cy
.
navigateToProducts
(
'
:nth-child(6) > .container > .row > :nth-child(2) > a > .btn
'
);
});
});
it
(
'
checks products portal via image
'
,
()
=>
{
cy
.
navigateToProducts
(
'
:nth-child(6) > .container > .row > .text-left > a > .img-fluid
'
);
})
it
(
'
checks products portal via anchor
'
,
()
=>
{
cy
.
navigateToProducts
(
'
:nth-child(5) > .nav-link
'
);
})
});
});
context
(
'
<who we are> links
'
,
()
=>
{
context
.
only
(
'
<who we are> links
'
,
()
=>
{
it
(
'
checks ETSI SDG OpenSlice Link
'
,
()
=>
{
it
(
'
checks ETSI SDG OpenSlice Link
'
,
()
=>
{
cy
.
get
(
'
.ng-star-inserted > :nth-child(1) > .text-white
'
).
click
();
cy
.
get
(
'
.ng-star-inserted > :nth-child(1) > .text-white
'
).
click
();
cy
.
origin
(
'
https://osl.etsi.org/
'
,
()
=>
{
cy
.
origin
(
'
https://osl.etsi.org/
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/support/commands.ts
+
79
−
10
View file @
b679c623
...
@@ -25,13 +25,82 @@
...
@@ -25,13 +25,82 @@
// -- This will overwrite an existing command --
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
//
// declare global {
declare
namespace
Cypress
{
// namespace Cypress {
// interface Chainable {
interface
Chainable
{
// login(email: string, password: string): Chainable<void>
navigateToServices
(
selector
):
Chainable
<
any
>
,
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
navigateToResources
(
selector
):
Chainable
<
any
>
,
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
navigateToTesting
(
selector
):
Chainable
<
any
>
,
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
navigateToProducts
(
selector
):
Chainable
<
any
>
// }
}
// }
}
// }
\ No newline at end of file
Cypress
.
Commands
.
add
(
'
navigateToServices
'
,
(
selector
)
=>
{
cy
.
get
(
selector
).
click
();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/services
"
);
cy
.
get
(
'
.btn
'
).
should
(
"
contain
"
,
"
Sign In
"
);
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
should
(
"
exist
"
);
//service marketplace button should exist and should redirect to /services_marketplace
cy
.
get
(
'
.mr-auto > .nav-item > .nav-link
'
).
click
();
cy
.
get
(
'
.jumbotron > h5.ng-tns-c147-1
'
).
should
(
"
contain
"
,
"
Browse available services and sign in to order
"
);
cy
.
get
(
'
.catalog-tree-header
'
).
should
(
"
exist
"
);
//sign in button should exist
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
click
();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
});
Cypress
.
Commands
.
add
(
'
navigateToResources
'
,
(
selector
)
=>
{
cy
.
get
(
selector
).
click
();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/resources
"
);
//sign in button should exist
cy
.
get
(
'
.btn
'
).
should
(
'
exist
'
).
click
();
//cy.get('nav-link').should('exist').click();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
})
Cypress
.
Commands
.
add
(
'
navigateToTesting
'
,
(
selector
)
=>
{
cy
.
get
(
selector
).
click
();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/testing
"
);
//sign in button should exist
cy
.
get
(
'
.btn
'
).
should
(
'
exist
'
).
click
();
//cy.get('nav-link').should('exist').click();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
});
Cypress
.
Commands
.
add
(
'
navigateToProducts
'
,
(
selector
)
=>
{
cy
.
get
(
selector
).
click
();
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/products
"
);
cy
.
get
(
'
.btn
'
).
should
(
"
contain
"
,
"
Sign In
"
);
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
should
(
"
exist
"
);
//marketplace button should exist and should redirect to products/marketplace
cy
.
get
(
'
.mr-auto > .nav-item > .nav-link
'
).
click
();
cy
.
get
(
'
.catalog-tree-header
'
).
should
(
"
exist
"
);
cy
.
get
(
'
.mb-0
'
).
should
(
"
contain
"
,
"
Product Catalog Explorer
"
);
//sign in button should exist
cy
.
get
(
'
:nth-child(2) > .nav-item > .nav-link
'
).
click
();
//sign in button should redirect to auth form
cy
.
origin
(
'
http://portal.openslice.eu
'
,
()
=>
{
cy
.
location
(
"
pathname
"
).
should
(
"
equal
"
,
"
/auth/realms/openslice/protocol/openid-connect/auth
"
);
});
})
\ No newline at end of file
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