* Centralises configuration for Puppeteer used in tests to make it easier to maintain.
* Adds support for running tests on ARM, so we can use Raspberry Pi test runners off the cloud to get around block lists.
* Includes improved stealth mode to avoid detection which breaks integration tests.
Full end-to-end integration tests for Twitter (OAuth 1) and GitHub (OAuth 2) using Puppeteer and Mocha.
This replaces Cypress tests due to issues with Cypress not being able to run tests against external URLs, which we need for our integration tests.
The integration test runner is hosted outside of GitHub Actions (it cannot be hosted by GitHub or on AWS due to IP access controls placed on sign in by providers like Twitter and GitHub) and so the integration tests may not pass if the test runner is offline. If this happens, tests can be re-run later when the test runner is available.
See Pull Request #641 for details.
Adds commands to start/rebuild/stop a Docker image of a sample Next.js app that loads the latest build of NextAuth.js from the current directory.
* `npm run test:app:start`
* `npm run test:app:rebuild`
* `npm run test:app:stop`
It is intended for further development for automated testing.
### About the build process
* The Dockerfile uses a multi-stage build process to optimise build performance, but the nature of the process is slow.
* Build times vary depending on computer speed and internet connection.
* Inital build times are slow (it may take 10 minutes or more).
* Subsequent builds on the same computer should be faster (1 minute or less).
* To ensure the package.json is valid, modules required in the next-auth package.json file are re-downloaded* on every build.
* A Docker compose file is used to allow us to extend the test app to run it again multiple databases.
Subsequent updates may look to improve performance, but it's important checks like checking package.json is valid and running the build in isolation are performed.
* Add cypress, testing-library/cypress and server dev helper to package dev dependencies
* Add initial signin test and placeholder cypress files
* Add initial signout tests
* Add initial verify-request test
* Move page-only tests into a 'pages' directory
* Add an invalid email signup workflow test
* Use home-page sign in button for email workflow
* Some tests to check that clicking the button takes the user to the correct OAuth page (warning: fragile!)
* Add a couple of npm scripts to make it easier to run/ developer e2e tests
Co-authored-by: Iain Collins <me@iaincollins.com>
Discord is migrating to discord.com, including their OAuth2 API routes. Support for the old domain, discordapp.com, will be dropped on 7 Nov 2020.
Note that the cdn.discordapp.com domain is unchanged. This is intentional, as the cdn domain will not be migrated due to technical restraints on Discord's side.