forked from ansible/awx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ansible#1280 from jakemcdermott/bug-1271
ensure correct auth and system configuration forms are loaded
- Loading branch information
Showing
8 changed files
with
174 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import breadcrumb from './sections/breadcrumb'; | ||
import header from './sections/header'; | ||
import navigation from './sections/navigation'; | ||
|
||
const sections = { | ||
header, | ||
navigation, | ||
breadcrumb, | ||
}; | ||
|
||
const commands = [{ | ||
load () { | ||
this.api.url('data:,'); // https://github.com/nightwatchjs/nightwatch/issues/1724 | ||
return this.navigate(); | ||
}, | ||
selectSubcategory (name) { | ||
const spinny = 'div.spinny'; | ||
const select = '#configure-dropdown-nav'; | ||
const arrow = `${select} + span span[class$="arrow"]`; | ||
const option = `//li[contains(text(), "${name}")]`; | ||
|
||
this.api.waitForElementVisible(arrow); | ||
this.api.click(arrow); | ||
|
||
this.api.useXpath(); | ||
this.api.waitForElementVisible(option); | ||
this.api.click(option); | ||
this.api.useCss(); | ||
|
||
return this; | ||
}, | ||
}]; | ||
|
||
module.exports = { | ||
url () { | ||
return `${this.api.globals.launch_url}/#/configuration`; | ||
}, | ||
sections, | ||
commands, | ||
}; |
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,24 @@ | ||
import breadcrumb from './sections/breadcrumb'; | ||
import header from './sections/header'; | ||
import navigation from './sections/navigation'; | ||
|
||
const sections = { | ||
header, | ||
navigation, | ||
breadcrumb, | ||
}; | ||
|
||
const commands = [{ | ||
load () { | ||
this.api.url('data:,'); // https://github.com/nightwatchjs/nightwatch/issues/1724 | ||
return this.navigate(); | ||
} | ||
}]; | ||
|
||
module.exports = { | ||
url () { | ||
return `${this.api.globals.launch_url}/#/home`; | ||
}, | ||
sections, | ||
commands, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
module.exports = { | ||
'expected LDAP codemirror fields are rendered when returning from another tab': client => { | ||
const authTab = '#auth_tab'; | ||
const authView = 'div[ui-view="auth"]'; | ||
const ldapForm = '#configuration_ldap_template_form'; | ||
const systemTab = '#system_tab'; | ||
const systemView = 'div[ui-view="system"]'; | ||
|
||
const { navigation } = client.page.dashboard().section; | ||
const configuration = client.page.configuration(); | ||
|
||
client.login(); | ||
client.waitForAngular(); | ||
|
||
navigation | ||
.waitForElementVisible('@settings') | ||
.click('@settings'); | ||
|
||
configuration.waitForElementVisible(authView); | ||
|
||
configuration.waitForElementVisible(systemTab); | ||
configuration.click(systemTab); | ||
|
||
configuration.waitForElementNotVisible(authView); | ||
configuration.waitForElementVisible(systemView); | ||
|
||
configuration.waitForElementVisible(authTab); | ||
configuration.click(authTab); | ||
|
||
configuration.waitForElementNotVisible(systemView); | ||
configuration.waitForElementVisible(authView); | ||
|
||
configuration.selectSubcategory('LDAP'); | ||
configuration.waitForElementVisible(ldapForm); | ||
|
||
const expectedCodemirrorFields = [ | ||
'AUTH_LDAP_USER_SEARCH', | ||
'AUTH_LDAP_GROUP_SEARCH', | ||
'AUTH_LDAP_USER_ATTR_MAP', | ||
'AUTH_LDAP_GROUP_TYPE_PARAMS', | ||
'AUTH_LDAP_USER_FLAGS_BY_GROUP', | ||
'AUTH_LDAP_ORGANIZATION_MAP', | ||
'AUTH_LDAP_TEAM_MAP', | ||
]; | ||
|
||
const ldapCodeMirrors = `${ldapForm} div[class^="CodeMirror"] textarea`; | ||
|
||
client.elements('css selector', ldapCodeMirrors, ({ value }) => { | ||
client.assert.equal(value.length, expectedCodemirrorFields.length); | ||
}); | ||
|
||
expectedCodemirrorFields.forEach(fieldName => { | ||
const codemirror = `#cm-${fieldName}-container div[class^="CodeMirror"]`; | ||
|
||
configuration.expect.element(codemirror).visible; | ||
configuration.expect.element(codemirror).enabled; | ||
}); | ||
|
||
client.end(); | ||
}, | ||
}; |