This is a Proof of Concept for Microsoft 365 test automation using Graph
Test Automation framework designed using Mocha, Chai, and Typescript. It is based on framework developed by qaloop
├───images
├───page-objects
├───test-suites
├───.gitignore
├───package.json
├───README.md
└───tslint.json
- Download and install Chrome or Firefox browser.
- Download and install Node.js:
- Optional - Download and install any Text Editor like Visual Code/Sublime/Brackets
- Clone the repository into a folder
- Go to Project root directory and install Dependency:
npm install
- All the dependencies from package.json and ambient typings would be installed in node_modules folder.
- Create an office developer account
- Register and setup OAuth App in Azure Portal
- OAuth App Setup guide
- For your app grant at least the following permission:
Mail.ReadWrite
- Create at least 2 test users on your Azure Active Directory
- This can be done e.g. using Sample data packs
For security reasons, the data required to authenticate to the Microsoft Graph are stored as environment variables (and github secrets for CI). The following Environment variables are needed for tests to run correctly:
CLIENT_ID
- ID of your OAuth AppCLIENT_SECRET
- Secret key for your OAuth AppUSER1_EMAIL
- email (and login) for 1st test userUSER1_PASSWORD
- password for 1st test userUSER2_EMAIL
- email (and login) for 2nd test userUSER2_PASSWORD
- password for 2nd test user
- Run complete Test Suite:
npm test
- Go to Project root directory and run command:
npm update
CI was configured using GitHub Actions. The configuration file is stored in .github/workflows/ci.yml
. CI job is triggered after each commit. CI stores test artifacts in GitHub, which can be accessed in the Actions tab for individual test runs.
To see a failing CI build you can see it on a Sample Pull Request in this repository.