2019-09-18 19:42:19 +02:00
|
|
|
describe('Interaction', () => {
|
2022-10-04 16:37:37 +08:00
|
|
|
describe('Security level loose', () => {
|
|
|
|
beforeEach(() => {
|
2019-09-18 19:42:19 +02:00
|
|
|
const url = 'http://localhost:9000/click_security_loose.html';
|
|
|
|
cy.viewport(1440, 1024);
|
|
|
|
cy.visit(url);
|
2022-10-04 16:37:37 +08:00
|
|
|
});
|
2019-09-18 19:42:19 +02:00
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Graph: should handle a click on a node with a bound function', () => {
|
|
|
|
cy.contains('FunctionTest1').parents('.node').click();
|
2019-09-18 19:42:19 +02:00
|
|
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
|
|
|
});
|
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Graph: should handle a click on a node with a bound function with args', () => {
|
|
|
|
cy.contains('FunctionArgTest2').parents('.node').click();
|
2020-12-17 19:58:25 +01:00
|
|
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
|
|
|
});
|
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Flowchart: should handle a click on a node with a bound function where the node starts with a number', () => {
|
|
|
|
cy.contains('2FunctionArg').parents('.node').click();
|
2020-12-17 19:58:25 +01:00
|
|
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Graph: should handle a click on a node with a bound url', () => {
|
|
|
|
// When there is a URL, cy.contains selects the a tag instead of the span. The .node is a child of a, so we have to use find instead of parent.
|
|
|
|
cy.contains('URLTest1').find('.node').click();
|
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2020-09-16 21:53:17 +02:00
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
|
|
cy.contains('2URL').find('.node').click();
|
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2020-09-16 21:53:17 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.contains('FunctionTest2').parents('.node').click();
|
2020-09-16 21:53:17 +02:00
|
|
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
|
|
|
});
|
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
|
|
|
|
cy.contains('10Function').parents('.node').click();
|
2020-09-16 21:53:17 +02:00
|
|
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
|
|
|
});
|
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
|
|
|
|
cy.contains('URLTest2').find('.node').click();
|
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2020-09-16 21:53:17 +02:00
|
|
|
});
|
|
|
|
});
|
2019-09-18 19:42:19 +02:00
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
|
|
// cy.contains('').click();
|
|
|
|
cy.contains('20URL').find('.node').click();
|
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl1').click({ force: true });
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl1-text').click({ force: true });
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2020-01-01 12:03:29 -08:00
|
|
|
it('should handle a click on a task with a bound function without args', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl2').click({ force: true });
|
2020-01-01 12:03:29 -08:00
|
|
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2020-01-01 12:03:29 -08:00
|
|
|
it('should handle a click on a task with a bound function with args', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl3').click({ force: true });
|
2020-01-01 12:03:29 -08:00
|
|
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle a click on a task with a bound function without args', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl2-text').click({ force: true });
|
2020-01-01 12:03:29 -08:00
|
|
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2020-01-01 12:03:29 -08:00
|
|
|
it('should handle a click on a task with a bound function with args ', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl3-text').click({ force: true });
|
2020-01-01 12:03:29 -08:00
|
|
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
|
|
|
});
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Interaction - security level tight', () => {
|
2022-10-04 16:37:37 +08:00
|
|
|
beforeEach(() => {
|
2019-09-18 19:42:19 +02:00
|
|
|
const url = 'http://localhost:9000/click_security_strict.html';
|
|
|
|
cy.viewport(1440, 1024);
|
|
|
|
cy.visit(url);
|
2022-10-04 16:37:37 +08:00
|
|
|
});
|
|
|
|
it('should handle a click on a node without a bound function', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('Function1').parents('.node').click();
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('1Function').parents('.node').click();
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a node with a bound url', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('URL1').find('.node').click();
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a node with a bound url where the node starts with a number', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('2URL').find('.node').click();
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl1').click({ force: true });
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl1-text').click({ force: true });
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a task with a bound function', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl2').click({ force: true });
|
|
|
|
cy.get('.created-by-gant-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a task with a bound function', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
|
|
cy.get('.created-by-gant-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Interaction - security level other, missspelling', () => {
|
2022-10-04 16:37:37 +08:00
|
|
|
beforeEach(() => {
|
2020-09-16 21:53:17 +02:00
|
|
|
const url = 'http://localhost:9000/click_security_other.html';
|
2019-09-18 19:42:19 +02:00
|
|
|
cy.viewport(1440, 1024);
|
|
|
|
cy.visit(url);
|
2022-10-04 16:37:37 +08:00
|
|
|
});
|
2019-09-18 19:42:19 +02:00
|
|
|
|
2022-10-04 16:37:37 +08:00
|
|
|
it('should handle a click on a node with a bound function', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('Function1').parents('.node').click();
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('1Function').parents('.node').click();
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a node with a bound url', () => {
|
2022-10-04 16:55:46 +08:00
|
|
|
cy.contains('URL1').find('.node').click();
|
2022-10-04 16:37:37 +08:00
|
|
|
cy.location().should(({ href }) => {
|
|
|
|
expect(href).to.eq('http://localhost:9000/webpackUsage.html');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle a click on a task with a bound function', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('rect#cl2').click({ force: true });
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-gant-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
2022-10-04 16:37:37 +08:00
|
|
|
|
2019-09-18 19:42:19 +02:00
|
|
|
it('should handle a click on a task with a bound function', () => {
|
2021-11-18 19:17:00 +01:00
|
|
|
cy.get('body').find('text#cl2-text').click({ force: true });
|
2021-07-07 16:41:36 +02:00
|
|
|
cy.get('.created-by-gant-click').should('not.exist');
|
2019-09-18 19:42:19 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|