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

[Identity] Two Playwright tests for the InteractiveBrowserCredential #21171

Closed
wants to merge 3 commits into from

Conversation

sadasant
Copy link
Contributor

@sadasant sadasant commented Apr 2, 2022

Playwright tests for the interactive browser credential.

Fixes #21166

Also arguably:

Fixes #14913
Fixes #14368

@ghost ghost added the Azure.Identity label Apr 2, 2022
@sadasant sadasant self-assigned this Apr 2, 2022
@azure-sdk
Copy link
Collaborator

API change check for @azure/identity

API changes are not detected in this pull request for @azure/identity

@@ -52,7 +52,8 @@
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 180000 'dist-esm/test/public/node/*.spec.js' 'dist-esm/test/internal/node/*.spec.js'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:playwright": "rimraf dist-playwright && npx playwright install && tsc -p playwright.tsconfig.json && rollup --config && playwright test -c dist-playwright",
"integration-test": "npm run integration-test:node && npm run integration-test:browser && npm run integration-test:playwright",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m having a hard time imagining how to merge this with our current setup 😅

@@ -33,3 +33,4 @@ stages:
IDENTITY_SP_CERT_SNI: $(Agent.TempDirectory)/testsni.pfx
IDENTITY_SP_CERT_SNI_PEM: $(Agent.TempDirectory)/testsni.pem
IDENTITY_PEM_CONTENTS: $(net-identity-spcert-pem)
AZURE_IDENTITY_BROWSER_CLIENT_ID: $(identity-azure-sdk-js-test-browser-client-id)
Copy link
Contributor Author

@sadasant sadasant Apr 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create an app registration with an “spa” redirect endpoint and store its client ID in the keyvault used for the CI en variables 🙂

@@ -52,7 +52,8 @@
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 180000 'dist-esm/test/public/node/*.spec.js' 'dist-esm/test/internal/node/*.spec.js'",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:playwright": "rimraf dist-playwright && npx playwright install && tsc -p playwright.tsconfig.json && rollup --config && playwright test -c dist-playwright",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx playwright install ensures that the web browser needed for testing is installed. Playwright doesn’t do that by default when you install it.

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

export { InteractiveBrowserCredential } from "../../../../src/credentials/interactiveBrowserCredential.browser";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I were to do this in another project, other than our SDK repo, I would load here the @azure/identity package, like:

export { InteractiveBrowserCredential } from "@azure/identity";

<html>
<head>
<meta charset="utf-8" />
<!-- /index.js is a route defined in the Express.js server -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- /index.js is a route defined in the Express.js server -->
<!-- /index.js is a route defined in the Express.js server -->
Suggested change
<!-- /index.js is a route defined in the Express.js server -->
<!-- /index.js is a route defined in the Express.js server -->

@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Jun 17, 2022
@ghost
Copy link

ghost commented Jun 17, 2022

Hi @sadasant. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@ghost ghost closed this Jun 24, 2022
@ghost
Copy link

ghost commented Jun 24, 2022

Hi @sadasant. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass.

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-js that referenced this pull request Oct 19, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity no-recent-activity There has been no recent activity on this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make a first Playwright test [Identity] Browser tests [Identity] Write mocked browser tests
2 participants