-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce faster component testing feature. Tabs tests. * Fix import.
- Loading branch information
1 parent
e1e6213
commit 4c4ecf0
Showing
13 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,37 @@ | ||
param( | ||
[Switch]$NoClose | ||
) | ||
|
||
Import-Module (Join-Path $PSScriptRoot "../../Selenium/Selenium.psm1") -Force | ||
#Don't auto-load the materialize from UD | ||
$Global:UDNoMaterialize = $true | ||
Import-Module (Join-Path $PSScriptRoot "../../output/UniversalDashboard.Community.psd1") -Force | ||
Import-Module (Join-Path $PSScriptRoot "../output/UniversalDashboard.Materialize/UniversalDashboard.Materialize.psd1") -Force | ||
|
||
$Tests = Get-ChildItem $PSScriptRoot -Filter "*.tests.ps1" | ||
|
||
$Dashboard = New-UDDashboard -Title "Test" -Content {} | ||
$Server = Start-UDDashboard -Port 10000 -Dashboard $Dashboard | ||
$Driver = Start-SeFirefox | ||
Enter-SeUrl -Url "http://localhost:10000" -Driver $Driver | ||
function Set-TestDashboard { | ||
param( | ||
[ScriptBlock]$Content | ||
) | ||
|
||
$Global:StateDictionary = @{} | ||
|
||
$Dashboard = New-UDDashboard -Content $Content -Title "TEST" -EndpointInitialization (New-UDEndpointInitialization -Variable "StateDictionary") | ||
$Server.DashboardService.SetDashboard($Dashboard) | ||
Enter-SeUrl -Url "http://localhost:10000" -Driver $Driver | ||
} | ||
|
||
$Tests | ForEach-Object { | ||
. $_.FullName | ||
} | ||
|
||
if (-not $NoClose) | ||
{ | ||
Stop-UDDashboard -Port 10000 | ||
Stop-SeDriver $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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Describe "New-UDTabContainer" { | ||
Context "Tabs" { | ||
Set-TestDashboard { | ||
New-UDTabContainer -Tabs { | ||
New-UDTab -Text "Tab1" -Content { New-UDCard -Title "Hi" -Content {} } | ||
New-UDTab -Text "Tab2" -Content { New-UDCard -Title "Hi2" -Content {} } | ||
} | ||
} | ||
|
||
It "has tabs" { | ||
Find-SeElement -Driver $Driver -ClassName "tabs" | should not be $null | ||
} | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.