Skip to content

Commit 17fe3b2

Browse files
committed
fix(cypress.json): fix ENV handling of API_HOST
1 parent 361a3bf commit 17fe3b2

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

cypress.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"baseUrl": "http://localhost:3000",
33
"ignoreTestFiles": "**/integration/examples/*.*",
44
"projectId": "ftw148",
5-
"experimentalFetchPolyfill": true
5+
"experimentalFetchPolyfill": true,
6+
"env": {
7+
"API_HOST": "http://localhost:8080"
8+
}
69
}

cypress/integration/01_connection_spec.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
context('Fusion Studio', () => {
33
describe('Connection Dialogue', () => {
44
after(() => {
5-
// cleanup connections before each test
5+
// cleanup connections after test
66
cy.visit('/')
77
cy.get('.fusion-item')
88
.rightclick()
@@ -11,6 +11,7 @@ context('Fusion Studio', () => {
1111
.click()
1212
cy.get('.main').click()
1313
})
14+
cy.clearLocalStorage()
1415
})
1516

1617
it('should create a connection', () => {
@@ -23,7 +24,7 @@ context('Fusion Studio', () => {
2324
.click()
2425
// set connection credentials
2526
cy.get('div.name-field > input').clear().type('server1')
26-
cy.get('div.server-field > input').clear().type('http://localhost:8080')
27+
cy.get('div.server-field > input').clear().type(Cypress.env('API_HOST'))
2728
cy.get('div.username-field > input').clear().type('admin')
2829
cy.get('div.password-field > input').clear()
2930
cy.get('.main').click()
@@ -48,7 +49,7 @@ context('Fusion Studio', () => {
4849
.then(() => {
4950
// bad credentials
5051
cy.get('div.name-field > input').clear().type('server2')
51-
cy.get('div.server-field > input').clear().type('http://localhost:8080')
52+
cy.get('div.server-field > input').clear().type(Cypress.env('API_HOST'))
5253
cy.get('div.username-field > input').clear().type('badmin')
5354
cy.get('.main').click()
5455
})
@@ -57,7 +58,7 @@ context('Fusion Studio', () => {
5758
cy.get('.ReactVirtualized__Grid')
5859
.should('be.visible')
5960
.should('contain', 'server2')
60-
cy.get(`[node-id=${CSS.escape('badmin@http://localhost:8080')}]`)
61+
cy.get(`[node-id=${CSS.escape('badmin@' + Cypress.env('API_HOST'))}]`)
6162
.click()
6263
.then(() => {
6364
cy.get('.dialogContent')
@@ -68,7 +69,7 @@ context('Fusion Studio', () => {
6869
})
6970

7071
it('should remove bad connection', () => {
71-
cy.get(`[node-id=${CSS.escape('badmin@http://localhost:8080')}]`)
72+
cy.get(`[node-id=${CSS.escape('badmin@' + Cypress.env('API_HOST'))}]`)
7273
.rightclick()
7374
.then(() => {
7475
cy.get('[data-command="fusion.disconnect"] > .p-Menu-itemLabel')

0 commit comments

Comments
 (0)