fix workflow e2e tests again

This commit is contained in:
Jake McDermott
2018-11-17 16:39:18 -05:00
parent 0e3bf6db09
commit fabe56088d
3 changed files with 59 additions and 96 deletions

View File

@@ -50,10 +50,12 @@ const readOrgPermissionResults = '//*[@id="permissions_table"]//*[text()="test-a
module.exports = { module.exports = {
before: (client, done) => { before: (client, done) => {
const namespace = 'test-org-permissions';
const resources = [ const resources = [
getUserExact('test-actions', 'test-actions-user'), getUserExact(namespace, `${namespace}-user`),
getOrganization('test-actions'), getOrganization(namespace),
getTeam('test-actions'), getTeam(namespace),
]; ];
Promise.all(resources) Promise.all(resources)

View File

@@ -140,31 +140,12 @@ module.exports = {
templates.expect.element('@save').enabled; templates.expect.element('@save').enabled;
client.pause(1000); client.pause(1000);
client.getValue('#workflow_job_template_name', result => { templates.section.editWorkflowJobTemplate
templates.expect.element('#workflow_job_template_cancel_btn').visible; .waitForElementVisible('@visualizerButton')
templates.click('#workflow_job_template_cancel_btn'); .click('@visualizerButton')
client.refresh(); .waitForElementVisible('div.spinny')
client.waitForElementVisible('div.spinny'); .waitForElementNotVisible('div.spinny')
client.waitForElementNotVisible('div.spinny'); .waitForAngular();
templates.expect.element('smart-search').visible;
templates.expect.element('smart-search input').enabled;
templates
.sendKeys('smart-search input', `name.iexact:"${result.value}"`)
.sendKeys('smart-search input', client.Keys.ENTER);
templates.waitForElementVisible('div.spinny');
templates.waitForElementNotVisible('div.spinny');
templates.expect.element('.at-Panel-headingTitleBadge').text.equal('1').before(10000);
templates.expect.element('div[ui-view="templatesList"] i[class*="sitemap"]').visible;
templates.expect.element('div[ui-view="templatesList"] i[class*="sitemap"]').enabled;
client
.click('div[ui-view="templatesList"] i[class*="sitemap"]')
.pause(1500)
.waitForElementNotVisible('div.spinny');
client.expect.element('#workflow-modal-dialog').visible; client.expect.element('#workflow-modal-dialog').visible;
client.expect.element('#workflow-modal-dialog span[class^="badge"]').visible; client.expect.element('#workflow-modal-dialog span[class^="badge"]').visible;
@@ -210,6 +191,5 @@ module.exports = {
templates.expect.element('@save').enabled; templates.expect.element('@save').enabled;
client.end(); client.end();
});
} }
}; };

View File

@@ -53,39 +53,20 @@ module.exports = {
data = { source, template, project, workflow }; data = { source, template, project, workflow };
done(); done();
}); });
},
'navigate to the workflow template visualizer': client => {
const templates = client.page.templates();
client.useCss();
client.resizeWindow(1200, 800);
client.login();
client.waitForAngular();
templates.load();
templates.waitForElementVisible('div.spinny');
templates.waitForElementNotVisible('div.spinny');
templates.expect.element('smart-search').visible;
templates.expect.element('smart-search input').enabled;
templates
.sendKeys('smart-search input', `id:>${data.workflow.id - 1} id:<${data.workflow.id + 1}`)
.sendKeys('smart-search input', client.Keys.ENTER);
templates.waitForElementVisible('div.spinny');
templates.waitForElementNotVisible('div.spinny');
templates.expect.element('.at-Panel-headingTitleBadge').text.equal('1').before(10000);
templates.expect.element(`#row-${data.workflow.id}`).visible;
templates.expect.element('div[ui-view="templatesList"] i[class*="sitemap"]').visible;
templates.expect.element('div[ui-view="templatesList"] i[class*="sitemap"]').enabled;
client client
.click('div[ui-view="templatesList"] i[class*="sitemap"]') .login()
.pause(1500) .waitForAngular()
.resizeWindow(1200, 1000)
.useXpath() .useXpath()
.waitForElementNotVisible(spinny); .findThenClick(workflowTemplateNavTab)
.pause(1500)
.waitForElementNotVisible(spinny)
.clearValue(workflowSearchBar)
.setValue(workflowSearchBar, [workflowText, client.Keys.ENTER])
.waitForElementVisible(workflowSearchBadgeCount)
.waitForElementNotVisible(spinny)
.findThenClick(workflowSelector)
.findThenClick(workflowVisualizerBtn);
}, },
'verify that workflow visualizer root node can only be set to always': client => { 'verify that workflow visualizer root node can only be set to always': client => {
client client