-
Notifications
You must be signed in to change notification settings - Fork 83
/
spec.cy.js
32 lines (24 loc) · 1.08 KB
/
spec.cy.js
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
describe('end-to-end', () => {
const uuid = () => Cypress._.random(0, 1e6)
const consumerUrl = Cypress.env('consumerUrl')
const providerUrl = Cypress.env('providerUrl')
it('should be accessible', () => {
cy.visit(consumerUrl);
cy.visit(providerUrl);
})
it('should create an asset and view it on provider side', function() {
cy.visit(providerUrl);
const id = uuid()
const name = `asset-${id}`
cy.get('[href="/my-assets"]').first().as('assets-menu-item').click();
cy.get('#mat-input-0').as('asset-filter')
cy.get('.container').contains('Create asset').as('open-new-asset-dialog').click();
cy.get('#mat-input-1').as('asset-id-field').clear();
cy.get('@asset-id-field').type(id);
cy.get('#mat-input-2').as('asset-name-field').clear('ra');
cy.get('@asset-name-field').type(name);
cy.get('mat-dialog-actions').click().contains('Create').as('confirm-create-asset').click();
cy.get('@asset-filter').click({force: true}).type(name);
cy.get('[fxLayout="row wrap"]').as('assets-list').find('mat-card').should('have.length', 1)
});
})