Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Jun 3, 2019
1 parent 5aa0615 commit 3de7be9
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/UniversalDashboard.UITest/Integration/Input.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,17 @@ Describe "Input" {
New-UDInputField -Type 'textbox' -Name 'test' -Placeholder 'Test testbox' -DefaultValue "Test"
New-UDInputField -Type 'checkbox' -Name 'test2' -Placeholder 'checkbox'
New-UDInputField -Type 'select' -Name 'test3' -Placeholder 'select' -Values @("Test", "Test2", "Test3") -DefaultValue "Test"
New-UDInputField -Type 'radioButtons' -Name 'test4' -Placeholder @("My Test Value", "My Test Value 2", "My Test Value 3") -Values @("MyTestValue", "MyTestValue2", "MyTestValue3")
New-UDInputField -Type 'radioButtons' -Name 'test4' -Values @("MyTestValue", "MyTestValue2", "MyTestValue3")

New-UDInputField -Type 'password' -Name 'test5' -Placeholder 'Password'
New-UDInputField -Type 'textarea' -Name 'test6' -Placeholder 'Big Box o Text'
New-UDInputField -Type 'switch' -Name 'test7' -Placeholder @("Yes", "No")
New-UDInputField -Type 'select' -Name 'test8' -Placeholder 'select2'
New-UDInputField -Type 'date' -Name 'test9' -Placeholder 'My Time'
New-UDInputField -Type 'time' -Name 'test10' -Placeholder 'My Date'
New-UDInputField -Type 'radioButtons' -Name 'test11' -Values @("1", "2", "3")
} -Endpoint {
param($Test, $Test2, $Test3, $Test4, $Test5, $Test6, $Test7, $Test8, $Test9, $Test10)
param($Test, $Test2, $Test3, $Test4, $Test5, $Test6, $Test7, $Test8, $Test9, $Test10, $test11)

$Cache:Output = [PSCustomObject]@{
test = $test
Expand All @@ -195,6 +196,7 @@ Describe "Input" {
test8 = $test8
test9 = $test9
test10 = $test10
test11 = $test11
}
}
}
Expand Down Expand Up @@ -304,8 +306,8 @@ Describe "Input" {


It "should select radio button" {
$Element = Find-SeElement -TagName "label" -Driver $Driver | Where-Object { (Get-SeElementAttribute $_ -Attribute "for") -eq 'radio0' }
Invoke-SeClick -Element $Element
$Element = Find-SeElement -TagName "label" -Driver $Driver | Where-Object { (Get-SeElementAttribute $_ -Attribute "for") -eq 'Formtest40' }
Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver

$Button = Find-SeElement -Id "btnForm" -Driver $Driver
Invoke-SeClick -Element $Button
Expand All @@ -315,6 +317,19 @@ Describe "Input" {
$Cache:Output.test4 | Should be "MyTestValue"
}


It "should select second radio button" {
$Element = Find-SeElement -TagName "label" -Driver $Driver | Where-Object { (Get-SeElementAttribute $_ -Attribute "for") -eq 'Formtest110' }
Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver

$Button = Find-SeElement -Id "btnForm" -Driver $Driver
Invoke-SeClick -Element $Button

Start-Sleep 1

$Cache:Output.test11 | Should be "1"
}

It "should switch the switch" {
$Element = Find-SeElement -Id "test7" -Driver $Driver
Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver
Expand Down

0 comments on commit 3de7be9

Please sign in to comment.