-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
End to End test framework for MSAL 1.0 and 2.0 #1393
Merged
Merged
Changes from 17 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
60a72e4
Adding sample code
pkanher617 8e428ff
adding end to end test framework for 2.0
pkanher617 851b97f
Update browser.spec.ts
pkanher617 507d026
Added end to end tests for 1.0, added end to end test command to pipe…
pkanher617 3578b55
Merge branch 'dev' into e2e-test-framework
pkanher617 90646d2
Added full automation with accounts
pkanher617 61b17ff
Update npm-build-steps.yml
pkanher617 4c5e91b
Adding test retries and increased timeout
pkanher617 bb82fa7
Merge branch 'dev' into e2e-test-framework
87236b6
Merge branch 'dev' into e2e-test-framework
pkanher617 a695442
Update authConfig.js
pkanher617 e6de02b
Renamed sample app folder, updated docs for samples, added names for …
pkanher617 07e657b
Update authConfig.js
pkanher617 bb93545
Merge branch 'dev' into e2e-test-framework
97c5089
Merge branch 'dev' into e2e-test-framework
pkanher617 3a39921
Merge branch 'dev' into e2e-test-framework
pkanher617 2e769f0
fixing e2e tests
pkanher617 d6fd112
attempting to fix e2e
pkanher617 575dfe6
fixing e2e
pkanher617 67b1b9c
Update browser.spec.ts
pkanher617 cb13a7e
Merge branch 'dev' into e2e-test-framework
pkanher617 4f0234b
Updating packages from dev deps to regular deps
pkanher617 e895fa3
Update browser.spec.ts
pkanher617 b40c829
Update browser.spec.ts
pkanher617 f1ddf09
Update browser.spec.ts
pkanher617 1172754
Update browser.spec.ts
pkanher617 fcebe62
Update azure-pipelines.yml
pkanher617 c34f43e
adding puppeteer to root dependencies to try to fix e2e
pkanher617 04fff18
changing name from TestCredential to LabClient
pkanher617 ba1aadb
adding timeout
pkanher617 4e7a2c3
Adding puppeteer vars to other tests
pkanher617 d77d36f
Merge branch 'dev' into e2e-test-framework
pkanher617 a2648c9
Adding better postinstall logic for scoped bootstraps in ci
pkanher617 a64fdfa
Update package.json
pkanher617 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"require": ["test/setup.js", "@babel/polyfill"], | ||
"require": ["e2eTests/testSetup.js", "@babel/polyfill"], | ||
"spec": ["./test/*.spec.ts", "./test/**/*.spec.ts"] | ||
} |
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 |
---|---|---|
@@ -1,25 +1,43 @@ | ||
What are the dev apps? | ||
---------------------- | ||
index.html shows how to get profile data and read email with the Microsoft Graph, using msal.js loginRedirect()/loginPopup()/acquireTokenSilent-acquireTokenPopup() APIs. | ||
# MSAL.js 1.x Sample - Authorization Code Flow in Single-Page Applications | ||
|
||
If loginRedirect() is used, the web page redirects to the Azure AD or Azure AD B2C login screen for authentication. Once authentication is completed, the page redirects back to the redirect uri given with the requested tokens. | ||
## About this sample | ||
This developer sample is used to run basic use cases for the MSAL library. You can also alter the configuration in `./app/<sample-name>/authConfig.js` to execute other behaviors. | ||
|
||
If loginPopup() is used, the authentication occurs inside a popup window created by the browser. The main window will handle token retrieval once authentication has been completed in the popup. | ||
## How to run the sample: | ||
|
||
How to run the dev apps: | ||
-------------------- | ||
Pre-requisite | ||
- Install node.js if needed (https://nodejs.org/en/) | ||
- Build the `msal-core` project. | ||
### Pre-requisites | ||
- Ensure [all pre-requisites](../../lib/msal-core/README.md#pre-requisites) have been completed to run msal-core. | ||
- Install node.js if needed (https://nodejs.org/en/). | ||
- Build the `msal-core` project with instructions provided in the [`README.md`](../../lib/msal-core/README.md) or using the command `npm run build:package`. | ||
|
||
Resolving the server.js references | ||
- In a command prompt, run `npm install` | ||
### Configure the application | ||
- Open `./app/<sample-name>/authConfig.js` in an editor. | ||
- Replace client id with the Application (client) ID from the portal registration, or use the currently configured lab registration. | ||
- Optionally, you may replace any of the other parameters, or you can remove them and use the default values. | ||
|
||
Running the sample | ||
- In a command prompt, run `npm start` | ||
#### Install npm dependencies for sample | ||
- In a command prompt, run `npm install`. | ||
|
||
You may also run `npm run start:build` to build the `msal-core` project and start the server in one command. | ||
#### Running the sample | ||
1. In a command prompt, run `npm start`. | ||
- If you wish to specify a different sample than the default, you may provide the sample name in the command prompt: | ||
```javascript | ||
npm start -- -sample <sample-name> // defaults to vanilla sample in `default` folder | ||
``` | ||
|
||
- Navigate to http://localhost:30662 with the browser of your choice | ||
```javascript | ||
npm start -- -s <sample-name> // defaults to vanilla sample in 'default' folder | ||
``` | ||
|
||
- In the web page, click on the "Sign In" button and select either `Sign in using Popup` or `Sign in using Redirect` | ||
- If you wish to specify the port, you can provide the `-p` or `-port` flag: | ||
```javascript | ||
npm start -- -port <port-#> // defaults to 30662 | ||
``` | ||
|
||
```javascript | ||
npm start -- -p <port-#> // defaults to 30662 | ||
``` | ||
|
||
- Navigate to http://localhost:30662 (or whatever port number specified) with the browser of your choice. | ||
|
||
- In the web page, click on the "Sign In" button and select either `Sign in using Popup` or `Sign in using Redirect` to begin the auth flow. |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...illaJSTestApp/JavascriptSPA/authConfig.js → ...anillaJSTestApp/app/default/authConfig.js
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we confirm msal-node works even with dummy tests? Or is that not a concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait! Is this only browser specific end-to-end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can include all end to end tests with this command, I will change the name to reflect this. For msal-browser and msal-core, the end to end tests are all browser based.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add whatever sample runs your node end to end tests when you have it created.