Skip to content

Commit

Permalink
[NOJIRA]
Browse files Browse the repository at this point in the history
Selenium test updates, WIP.
  • Loading branch information
Bill Smith committed Mar 5, 2019
1 parent a7b6d19 commit 53048f2
Show file tree
Hide file tree
Showing 9 changed files with 457 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ActiveProfiles
import spock.lang.Ignore
import spock.lang.Specification
import spock.lang.Unroll

Expand All @@ -17,6 +18,28 @@ class SeleniumSIDETest extends Specification {
@Value('${local.server.port}')
int randomPort

def "Selenium: just run one"() {
setup:
def file = "/CreateMetadataSourceFromCopy.side"
def main = new Main()
def config = new DefaultConfig([] as String[]).with {
System.properties.contains('')
if (System.properties.getProperty('webdriver.driver')) {
it.driver = System.properties.getProperty('webdriver.driver')
}
it.baseurl = "http://localhost:${this.randomPort}"
it
}
def runner = new Runner()
main.setupRunner(runner, config, [] as String[])

expect:
def result = runner.run(file, this.class.getResourceAsStream(file))
runner.finish()

assert result.level.exitCode == 0
}

@Unroll
def "#name"() {
setup:
Expand All @@ -40,19 +63,19 @@ class SeleniumSIDETest extends Specification {

where:
name | file
// 'Create Dynamic HTTP Metadata Resolver' | '/dhmr.side' //passing
// 'Metadata Source Happy Path Save' | '/MetadataSourceHappyPathSAVE.side' //passing
// 'Metadata Provider Happy Path Save' | '/MetadataProviderHappyPathSAVE.side' // failing (decimal point bug)
// 'Create Filter Entity ID' | '/CreateFilterEntityID.side' // failing (decimal point bug)
// 'Create Filter REGEX' | '/CreateFilterREGEX.side' // failing (decimal point bug)
// 'Create Filter Script' | '/CreateFilterScript.side' // failing (decimal point bug)
'Create Dynamic HTTP Metadata Resolver' | '/dhmr.side'
'Metadata Source Happy Path Save' | '/MetadataSourceHappyPathSAVE.side'
'Metadata Provider Happy Path Save' | '/MetadataProviderHappyPathSAVE.side'
'Create Filter Entity ID' | '/CreateFilterEntityID.side'
'Create Filter REGEX' | '/CreateFilterREGEX.side'
'Create Filter Script' | '/CreateFilterScript.side'
// 'Create Metadata Source From XML' | '/CreateMetadataSourceFromXML.side' // failing (Failure: Cannot click <input type=file> elements)
// 'Create Metadata Source From Copy' | '/CreateMetadataSourceFromCopy.side' //passing
// 'Delete Entity ID Filter' | '/DeleteEntityIDFilter.side' // failing (decimal point bug, possibly also incomplete)
// 'Delete REGEX Filter' | '/DeleteREGEXFilter_Incomplete.side' // incomplete
// 'Create Metadata Source from URL' | '/CreateMetadataSourceFromURL.side' //passing
// 'Delete Incomplete Source' | '/DeleteIncompleteSource_Incomplete.side' // incomplete
// 'Admin Login' | '/SHIBUI-1031_AdminLogin.side'
'Delegated Admin: SubmitSourceWithError' | '/SHIBUI-1058_DelegatedAdmin_SubmitSourceWithError.side' //passing, but with heap problem
// 'Delegated Admin: SubmitSourceWithError' | '/SHIBUI-1058_DelegatedAdmin_SubmitSourceWithError.side' //passing, but with heap problem
}
}
90 changes: 62 additions & 28 deletions backend/src/integration/resources/CreateFilterEntityID.side
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
{
"id": "16b5f41b-30c1-4cc1-9c9e-bc15e40d1318",
"version": "1.1",
"version": "2.0",
"name": "ShibUI",
"url": "http://localhost:10101/",
"tests": [{
"id": "daacdb81-2f14-49f3-8d15-da5f5d52586c",
"name": "nada",
"name": "FBHMR - Entity Attributes - Entity ID",
"commands": [{
"id": "227fe3ca-ebb3-46ee-8067-eb1bd1290801",
"id": "c023f973-f799-4dc3-90d0-d75ccade0317",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"target": "/login",
"targets": [],
"value": ""
}, {
"id": "853ef897-df38-4b31-ad06-3598bf9bc5e2",
"id": "492f48b4-97f8-4cb7-b8de-abf963b576af",
"comment": "Use User Login",
"command": "type",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=tr:nth-child(1) input", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "f61dd17c-d2ee-4200-a8f7-96d841d4ccb8",
"comment": "Use User Password",
"command": "type",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=tr:nth-child(2) input", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//tr[2]/td[2]/input", "xpath:position"]
],
"value": "adminpass"
}, {
"id": "fdb5a585-49aa-403c-8c23-c4fc548267b3",
"comment": "",
"command": "assertText",
"target": "css=body",
"command": "click",
"target": "name=submit",
"targets": [
["css=body", "css"],
["css=body", "css:finder"],
["xpath=//body", "xpath:position"]
["name=submit", "name"],
["css=td:nth-child(1) > input", "css:finder"],
["xpath=//input[@name='submit']", "xpath:attributes"],
["xpath=//tr[3]/td/input", "xpath:position"]
],
"value": "yes, you did it"
"value": ""
}, {
"id": "effbf04c-a1fa-411e-a47f-0b71acfbf4b2",
"comment": "",
Expand Down Expand Up @@ -615,7 +640,7 @@
["css=.px-2", "css:finder"],
["xpath=//div[2]/div[2]", "xpath:position"]
],
"value": "Metadata Provider: FBHMP\\nFileBackedHttpMetadataResolver"
"value": "Metadata Provider: FBHMP FileBackedHttpMetadataResolver"
}, {
"id": "108a25aa-6b33-4fa2-870d-ee413d7eb986",
"comment": "",
Expand All @@ -639,19 +664,29 @@
],
"value": ""
}, {
"id": "5693bc4b-80b7-41e3-885b-0911a4835211",
"id": "5693bc4b-80b7-41e3-885b-0911a4835212",
"comment": "",
"command": "click",
"target": "id=field33",
"target": "name=type",
"targets": [
["id=field33", "id"],
["name=field33", "name"],
["css=#field33", "css"],
["css=#field33", "css:finder"],
["xpath=//input[@id='field33']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
["name=type", "name"],
["css=.is-valid", "css:finder"],
["xpath=//select[@name='type']", "xpath:attributes"],
["xpath=//select", "xpath:position"]
],
"value": ""
}, {
"id": "5693bc4b-80b7-41e3-885b-0911a4835211",
"comment": "",
"command": "select",
"target": "name=type",
"targets": [
["name=type", "name"],
["css=.is-valid", "css:finder"],
["xpath=//select[@name='type']", "xpath:attributes"],
["xpath=//select", "xpath:position"]
],
"value": "label=EntityAttributes"
}, {
"id": "31dca951-b673-41a5-9430-184ed7d8a170",
"comment": "",
Expand Down Expand Up @@ -684,14 +719,13 @@
"id": "a453edf2-c8c5-47d1-86a2-c59d30d0935f",
"comment": "",
"command": "click",
"target": "id=undefined__option--0",
"target": "id=targetInput",
"targets": [
["id=undefined__option--0", "id"],
["css=#undefined__option--0", "css"],
["css=#undefined__option--0", "css:finder"],
["xpath=//li[@id='undefined__option--0']", "xpath:attributes"],
["xpath=//ul[@id='__listbox']/li", "xpath:idRelative"],
["xpath=//auto-complete/div/ul/li", "xpath:position"]
["id=targetInput", "id"],
["css=#targetInput", "css:finder"],
["xpath=//input[@id='targetInput']", "xpath:attributes"],
["xpath=//div[@id='-container']/div/input", "xpath:idRelative"],
["xpath=//div/div/input", "xpath:position"]
],
"value": ""
}, {
Expand Down Expand Up @@ -925,4 +959,4 @@
}],
"urls": ["http://localhost:10101/"],
"plugins": []
}
}
97 changes: 79 additions & 18 deletions backend/src/integration/resources/CreateFilterREGEX.side
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
{
"id": "16b5f41b-30c1-4cc1-9c9e-bc15e40d1318",
"version": "1.1",
"version": "2.0",
"name": "ShibUI",
"url": "http://localhost:10101/",
"tests": [{
"id": "daacdb81-2f14-49f3-8d15-da5f5d52586c",
"name": "Create Filter REGEX",
"commands": [{
"id": "227fe3ca-ebb3-46ee-8067-eb1bd1290801",
"id": "c023f973-f799-4dc3-90d0-d75ccade0317",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"target": "/login",
"targets": [],
"value": ""
}, {
"id": "853ef897-df38-4b31-ad06-3598bf9bc5e2",
"id": "492f48b4-97f8-4cb7-b8de-abf963b576af",
"comment": "Use User Login",
"command": "type",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=tr:nth-child(1) input", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "f61dd17c-d2ee-4200-a8f7-96d841d4ccb8",
"comment": "Use User Password",
"command": "type",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=tr:nth-child(2) input", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//tr[2]/td[2]/input", "xpath:position"]
],
"value": "adminpass"
}, {
"id": "fdb5a585-49aa-403c-8c23-c4fc548267b3",
"comment": "",
"command": "assertText",
"target": "css=body",
"command": "click",
"target": "name=submit",
"targets": [
["css=body", "css"],
["css=body", "css:finder"],
["xpath=//body", "xpath:position"]
["name=submit", "name"],
["css=td:nth-child(1) > input", "css:finder"],
["xpath=//input[@name='submit']", "xpath:attributes"],
["xpath=//tr[3]/td/input", "xpath:position"]
],
"value": "yes, you did it"
"value": ""
}, {
"id": "effbf04c-a1fa-411e-a47f-0b71acfbf4b2",
"comment": "",
Expand Down Expand Up @@ -615,7 +640,7 @@
["css=.px-2", "css:finder"],
["xpath=//div[2]/div[2]", "xpath:position"]
],
"value": "Metadata Provider: FBHMP\\nFileBackedHttpMetadataResolver"
"value": "Metadata Provider: FBHMP FileBackedHttpMetadataResolver"
}, {
"id": "b8c89883-4999-4429-a4f0-b20f7dbc825c",
"comment": "",
Expand All @@ -638,6 +663,30 @@
["xpath=//div[2]/a/translate-i18n", "xpath:position"]
],
"value": ""
}, {
"id": "5693bc4b-80b7-41e3-885b-0911a4835212",
"comment": "",
"command": "click",
"target": "name=type",
"targets": [
["name=type", "name"],
["css=.is-valid", "css:finder"],
["xpath=//select[@name='type']", "xpath:attributes"],
["xpath=//select", "xpath:position"]
],
"value": ""
}, {
"id": "5693bc4b-80b7-41e3-885b-0911a4835211",
"comment": "",
"command": "select",
"target": "name=type",
"targets": [
["name=type", "name"],
["css=.is-valid", "css:finder"],
["xpath=//select[@name='type']", "xpath:attributes"],
["xpath=//select", "xpath:position"]
],
"value": "label=EntityAttributes"
}, {
"id": "a69166b9-4073-4653-987d-0537702f5dbb",
"comment": "",
Expand Down Expand Up @@ -681,13 +730,14 @@
"id": "bcb6b08c-2c96-4662-9615-172c5cca5555",
"comment": "",
"command": "click",
"target": "linkText=Regex",
"target": "css=.dropdown-item:nth-child(2)",
"targets": [
["linkText=Regex", "linkText"],
["css=.dropdown-item:nth-child(2)", "css:finder"],
["xpath=//a[contains(text(),'Regex')]", "xpath:link"],
["xpath=(//a[contains(@href, '#')])[2]", "xpath:href"],
["xpath=//div/div/a[2]", "xpath:position"]
["xpath=//div/div/a[2]", "xpath:position"],
["xpath=//a[contains(.,'Regex')]", "xpath:innerText"]
],
"value": ""
}, {
Expand Down Expand Up @@ -745,7 +795,7 @@
["xpath=//input[@id='targetInput']", "xpath:attributes"],
["xpath=//div/div/input", "xpath:position"]
],
"value": "/foo.*/"
"value": "foo.*"
}, {
"id": "9c0fcb70-83f6-45b5-b5ef-d0ff7bdc80cb",
"comment": "",
Expand Down Expand Up @@ -808,15 +858,26 @@
["xpath=//div/button", "xpath:position"]
],
"value": ""
}, {
"id": "e54836ef-e3ac-41df-9989-ca8abffa0ee5",
"comment": "",
"command": "waitForElementPresent",
"target": "css=.td-lg:nth-child(3)",
"targets": [
["css=.td-lg:nth-child(3)", "css:finder"],
["xpath=//td[3]", "xpath:position"],
["xpath=//td[contains(.,'REGEX')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "8d472caf-2525-4e20-9f14-195e0212f72f",
"comment": "",
"command": "assertText",
"target": "css=td.td-lg",
"target": "css=.td-lg:nth-child(3)",
"targets": [
["css=td.td-lg", "css"],
["css=.td-lg:nth-child(3)", "css:finder"],
["xpath=//td[3]", "xpath:position"]
["xpath=//td[3]", "xpath:position"],
["xpath=//td[contains(.,'REGEX')]", "xpath:innerText"]
],
"value": "REGEX"
}]
Expand All @@ -831,4 +892,4 @@
}],
"urls": ["http://localhost:10101/"],
"plugins": []
}
}
Loading

0 comments on commit 53048f2

Please sign in to comment.