-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
packages/ui-tests/cypress/e2e/designer/routeBeanConf.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
describe('Test for node bean reference and configuration support', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Beans - create a new bean in route using bean editor', () => { | ||
cy.uploadFixture('flows/SqlBeansCR.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.openStepConfigurationTab('sql'); | ||
cy.configureNewBeanReference('parameters.dataSource'); | ||
cy.get(`input[name="name"]`).clear().type('test'); | ||
cy.get(`input[name="type"]`).clear().type('org.acme'); | ||
|
||
cy.expandWrappedSection('properties'); | ||
cy.get('[data-testid="properties-add-string-property--btn"]').not(':hidden').first().click({ force: true }); | ||
cy.get('[data-testid="properties--placeholder-name-input"]').should('not.be.disabled'); | ||
cy.get('[data-testid="properties--placeholder-name-input"]').click({ force: true }); | ||
cy.get('[data-testid="properties--placeholder-name-input"]').clear().type('test'); | ||
|
||
cy.get('[data-testid="properties--placeholder-value-input"]').should('not.be.disabled'); | ||
cy.get('[data-testid="properties--placeholder-value-input"]').click({ force: true }); | ||
cy.get('[data-testid="properties--placeholder-value-input"]').clear().type('value'); | ||
|
||
cy.get('[data-testid="properties--placeholder-property-edit-confirm--btn"]').click({ force: true }); | ||
|
||
cy.get('[data-testid="create-bean-btn"').click(); | ||
cy.closeStepConfigurationTab(); | ||
cy.openSourceCode(); | ||
|
||
// CHECK the bean was created in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('- beans:'); | ||
cy.checkCodeSpanLine('- name: test'); | ||
cy.checkCodeSpanLine('type: org.acme'); | ||
cy.checkCodeSpanLine('properties:'); | ||
cy.checkCodeSpanLine('test: value'); | ||
// CHECK the bean is referenced in the code editor | ||
cy.checkCodeSpanLine('dataSource: "#test"'); | ||
}); | ||
|
||
it('Beans - select existing bean in node form config', () => { | ||
cy.openSourceCode(); | ||
cy.uploadFixture('flows/SqlBeansCR.yaml'); | ||
|
||
cy.openDesignPage(); | ||
cy.openStepConfigurationTab('sql'); | ||
cy.configureBeanReference('parameters.dataSource', 'mysqlPostgreSqlSource'); | ||
cy.openSourceCode(); | ||
|
||
// CHECK the bean update was reflected in the code editor | ||
cy.checkCodeSpanLine('dataSource: "#mysqlPostgreSqlSource"'); | ||
}); | ||
|
||
// blocked by https://github.com/KaotoIO/kaoto-next/issues/559 | ||
it.skip('Beans - unselect selected bean', () => { | ||
cy.openSourceCode(); | ||
cy.uploadFixture('flows/SqlBeansCR.yaml'); | ||
|
||
cy.openDesignPage(); | ||
cy.openStepConfigurationTab('sql'); | ||
cy.configureBeanReference('parameters.dataSource', 'mysqlPostgreSqlSource'); | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('dataSource: "#mysqlPostgreSqlSource"'); | ||
|
||
cy.openDesignPage(); | ||
cy.openStepConfigurationTab('sql'); | ||
cy.deselectNodeBean('parameters.dataSource'); | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('dataSource: "#mysqlPostgreSqlSource"', 0); | ||
}); | ||
|
||
// blocked by https://github.com/KaotoIO/kaoto-next/issues/558 | ||
it.skip('Beans - delete bean using the bean editor', () => { | ||
cy.uploadFixture('flows/SqlBeansCR.yaml'); | ||
cy.openDesignPage(); | ||
cy.openStepConfigurationTab('sql'); | ||
cy.configureBeanReference('parameters.dataSource', 'mysqlPostgreSqlSource'); | ||
|
||
cy.openBeans(); | ||
// Remove the bean | ||
cy.get('[data-testid="metadata-delete-1-btn"]').click(); | ||
cy.get('[data-testid="metadata-row-1"]').should('not.exist'); | ||
cy.openDesignPage(); | ||
cy.openStepConfigurationTab('sql'); | ||
cy.get(`div[data-fieldname="parameters.dataSource"] input[value="#mysqlPostgreSqlSource"]`).should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- route: | ||
id: SqlBeansRoute | ||
from: | ||
uri: timer | ||
steps: | ||
- to: | ||
uri: sql | ||
- to: | ||
uri: log:test | ||
- beans: | ||
- name: mysqlDataSource | ||
type: io.kaoto.MysqlDataSource | ||
properties: | ||
port: "3306" | ||
url: jdbc:mysql://localhost/test | ||
username: dbuser | ||
password: dbpass | ||
driver-class-name: com.mysql.jdbc.Driver | ||
- name: mysqlPostgreSqlSource | ||
type: io.kaoto.MysqlPostgreSqlSource | ||
properties: | ||
port: "5432" | ||
url: jdbc:postgresql://localhost/test | ||
username: dbuser | ||
password: dbpass | ||
driver-class-name: org.postgresql.Driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters