Skip to content

Commit

Permalink
Cypress tests on uninitialized cluster (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: Yaroslav Dynnikov <[email protected]>
  • Loading branch information
Errora and rosik committed Jan 15, 2020
1 parent 0fcee18 commit 5d8caaf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions test/cypress/basic_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,12 @@ end
function g.test_schema_editor()
cypress_run('schema-editor.spec.js')
end

function g.test_uninitialized()
local code = os.execute(
'cd webui && npx cypress run' ..
' --config baseUrl="http://localhost:8085"' ..
' --spec cypress/integration/uninitialized.spec.js'
)
t.assert_equals(code, 0)
end
2 changes: 1 addition & 1 deletion webui/cypress/integration/schema-editor.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Schema section', () => {
it('Empty', () => {
it('Schema with bootstrap', () => {
const selectAllKeys = Cypress.platform == 'darwin' ? '{cmd}a' : '{ctrl}a';
const defaultText = '---\nspaces: []\n...\n';

Expand Down
14 changes: 14 additions & 0 deletions webui/cypress/integration/uninitialized.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('Schema section', () => {
it('Schema without bootstrap', () => {
cy.visit(Cypress.config('baseUrl')+"/admin/cluster/schema");

cy.get('button[type="button"]:contains("Validate")').click();
cy.get('#root').contains('Cluster isn\'t bootstrapped yet');

cy.get('button[type="button"]:contains("Reload")').click();
cy.get('.monaco-editor textarea').should('have.value', '');

cy.get('button[type="button"]:contains("Apply")').click();
cy.get('#root').contains('Cluster isn\'t bootstrapped yet');
});
});

0 comments on commit 5d8caaf

Please sign in to comment.