Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add browser auth integration test #119

Merged
merged 34 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d96fc59
initial setup
benpolinsky Feb 27, 2023
8c3d141
Revert "Update browser authorization to oidc-client-ts (#88)"
benpolinsky Feb 27, 2023
121b161
Revert "Revert "Update browser authorization to oidc-client-ts (#88)""
benpolinsky Feb 27, 2023
31a2a2f
add callback handler for test
benpolinsky Feb 28, 2023
3372221
Merge branch 'main' into bdp/add-browser-auth-integration-test
ben-polinsky Feb 28, 2023
faf5984
Add browser auth integration tests
ben-polinsky Mar 2, 2023
96316ee
correct integration test command
ben-polinsky Mar 2, 2023
222a70c
rename env variables for ci
ben-polinsky Mar 2, 2023
9c36a42
playwright binary config attempt
ben-polinsky Mar 2, 2023
97adfeb
More playwright config
ben-polinsky Mar 2, 2023
eff0481
Attempt to specify binaries directory for pw browsers
ben-polinsky Mar 2, 2023
464b7c7
debug playwright tests
ben-polinsky Mar 2, 2023
f9afdbe
update junit results path to debug
ben-polinsky Mar 2, 2023
1904188
try to pass password directly
ben-polinsky Mar 2, 2023
8ecbc1e
add screenshots
ben-polinsky Mar 2, 2023
603bdd6
screenshot config and publish
ben-polinsky Mar 2, 2023
8e75c75
add consent screen confirm; add screenshots on failure
ben-polinsky Mar 3, 2023
7ccbda2
correct build sources directory variable and enable video
ben-polinsky Mar 3, 2023
cb84391
add various waits
ben-polinsky Mar 3, 2023
9656c9c
log local storage
ben-polinsky Mar 3, 2023
2fad8e8
update localstorage finding logic
ben-polinsky Mar 3, 2023
2b9cb8f
remove video publishing; other cleanup
ben-polinsky Mar 3, 2023
1fc60e5
use env in test app
ben-polinsky Mar 3, 2023
afca90d
fix playwright reporter types
ben-polinsky Mar 3, 2023
3cabeed
env variable casing perhaps
ben-polinsky Mar 3, 2023
7a54d60
Merge branch 'main' into bdp/add-browser-auth-integration-test
ben-polinsky Mar 3, 2023
f7bae07
rush change
ben-polinsky Mar 3, 2023
dd9c788
lint fixes; bit of cleanup
ben-polinsky Mar 3, 2023
e7765b9
move env.example
ben-polinsky Mar 6, 2023
fa3d8b5
no need for initial rush binary install
ben-polinsky Mar 7, 2023
df6cbec
alphabetize package.json; copyright; cleanup
ben-polinsky Mar 8, 2023
8fccd53
rush update
ben-polinsky Mar 8, 2023
df862bb
Merge branch 'main' into bdp/add-browser-auth-integration-test
ben-polinsky Mar 8, 2023
7d0a386
add integration test setup to readme
ben-polinsky Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ node_modules
package-lock.json
pnpm-lock.yaml
.pnpm-store

# build output

/**/lib
packages/browser/dist

# testing
.nyc_output
.parcel-cache
junit_results.xml
/**/test-results/**/*

# pnpm
.pnpm-debug.log
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/browser-authorization",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/browser-authorization"
}
23 changes: 20 additions & 3 deletions common/config/azure-pipelines/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
echo "##vso[task.setvariable variable=IMJS_TEST_MANAGER_USER_PASSWORD;]$test_manager_user_password"
echo "##vso[task.setvariable variable=IMJS_TEST_REGULAR_USER_PASSWORD;]$test_reg_password"
echo "##vso[task.setvariable variable=IMJS_TEST_AZUREAD_USER_PASSWORD;]$test_azuread_user_password"
echo "##vso[task.setvariable variable=PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD;]1"
echo "##vso[task.setvariable variable=PLAYWRIGHT_BROWSERS_PATH;]$(Build.BinariesDirectory)/pw-browsers"
export
displayName: 'Add config to environment'
env:
Expand All @@ -55,6 +57,9 @@ jobs:
Write-Host "##vso[task.setvariable variable=IMJS_TEST_MANAGER_USER_PASSWORD;]$Env:test_manager_user_password"
Write-Host "##vso[task.setvariable variable=IMJS_TEST_REGULAR_USER_PASSWORD;]$Env:test_reg_password"
Write-Host "##vso[task.setvariable variable=IMJS_TEST_AZUREAD_USER_PASSWORD;]$Env:test_azuread_user_password"
Write-Host "##vso[task.setvariable variable=IMJS_TEST_AZUREAD_USER_PASSWORD;]$Env:test_azuread_user_password"
Write-Host "##vso[task.setvariable variable=PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD;]1"
Write-Host "##vso[task.setvariable variable=PLAYWRIGHT_BROWSERS_PATH;]$(Build.BinariesDirectory)/pw-browsers"
displayName: 'Add config to environment'
env:
test_super_manager_password: $(IMJS_SUPER_MANAGER_USER_PASSWORD)
Expand All @@ -72,6 +77,9 @@ jobs:
- script: node common/scripts/install-run-rush.js install
displayName: Rush Install

- script: npx playwright install
displayName: Install Playwright

- script: node common/scripts/install-run-rush.js build -v --to oidc-signin-tool
displayName: Rush Build

Expand All @@ -80,10 +88,19 @@ jobs:
env:
# Couldn't get this variable to be ingested in the steps above, but this works
IMJS_TEST_AZUREAD_USER_PASSWORD: $(IMJS_TEST_AZUREAD_USER_PASSWORD)
IMJS_TEST_REGULAR_USER_PASSWORD: $(IMJS_TEST_REGULAR_USER_PASSWORD)
DEBUG: pw:api

- task: PublishTestResults@2
displayName: "Publish OIDC Signin Tool Test Results"
displayName: "Publish Integration Test Results"
inputs:
testResultsFiles: "packages/oidc-signin-tool/lib/test/junit_results.xml"
testRunTitle: "Tools - OIDC Signin Tool - $(Agent.OS)"
testResultsFiles: "packages/**/junit_results.xml"
testRunTitle: "Tools - auth-clients - $(Agent.OS)"
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/packages/browser/test-results'
ArtifactName: 'screenshots'
publishLocation: 'Container'
condition: Failed()
4 changes: 2 additions & 2 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"commandKind": "bulk",
"summary": "Run test:integration script for each package",
"description": "Iterates through each package in the monorepo and runs the 'test:integration' script",
"enableParallelism": true,
"enableParallelism": false,
"ignoreMissingScript": true,
"ignoreDependencyOrder": true,
"allowWarningsInSuccessfulBuild": true
Expand Down Expand Up @@ -62,4 +62,4 @@
"allowWarningsInSuccessfulBuild": true
}
]
}
}
Loading