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

783 run the cypress tests against the procaptcha bundle #785

Merged
merged 64 commits into from
Nov 21, 2023

Conversation

forgetso
Copy link
Member

@forgetso forgetso commented Nov 14, 2023

  • Adds npm script to remove polkadotJS warnings
  • Changes build commands to bundle when bundling @prosopo/procaptcha-bundle and @prosopo/cli
  • Builds a test version of the bundle in CI
  • Moves the cypress tests to their own package @prosopo/cypress-shared
  • Removes the need for using outdated cypress-promise package in testing
  • Runs the cypress tests over both client-example and client-bundle-example
  • Adds a CJS build command and tsconfig for @prosopo/captcha-contract
  • Changes the port for @prosopo/client-bundle-example to 9232
  • Changes @prosopo/client-example-server run command to use tsc dist/app.js instead of node bundle.js to avoid bunding, saving time.
  • Uses concurrrently as vite does not respond as a suspended process
  • Reduces log output from polkadot exclude.ts
  • Changes the functionality of the dapp setup script to allow registering of dapp set in DAPP_SITE_KEY
  • Moves the demo dataset from provider to datasets
  • Creates a version of the demo dataset that includes all hashes and another version that contains solutions as number[]
  • Adds a function to update @prosopo/client-bundle-example with the new DAPP_SITE_KEY whenever npm run setup has run
  • removes npm deploy_dapp from setup:all as the dapp contract is no longer required to register a dapp
  • Adds missing references to tsconfig.json files
  • Fixes start command for provide API by forcing it to serve 2 solved captcha and 0 unsolved (We have no unsolved now)
  • Enforces solution arrays in datasets to be 0x{string}[] when importing, instead of just string[]
  • Adds a getSolutions function to the database layer
  • Adds a type for captcha API response CaptchaResponseBody
  • Fixes occasionally failing test in tasks.test.ts by fixing the datasetId to a specific value and not relying on getRandomActiveProvider contract call (this is tested in the frontend)

TODO

  • Remove or fix the unsolved feature for serving datasets. We can't leave this config hard coded in provider CLI.
  • Identify why vitest is running provider tests twice
  • Add types for all captcha API responses

- Add package cypress-vite to @prosopo/cypress-shared
- Use constant data without unsolved captcha for tests
- Move demo dataset to datasets package
- Use demo dataset from import instead of JSON file when setting up provider
- Make datasetID optional when exporting dataset
- Force the API config to solved=2 and unsolved=0
- Add a method to export solutions from the database
- Ensure that captcha IDs that are strings are hex when importing
- Set the default count for unsolved to 0 in the config
- Add CJS tsconfig and build command for @prosopo/captcha-contract package
@forgetso forgetso merged commit 1c3b4cf into main Nov 21, 2023
10 checks passed
@forgetso forgetso deleted the 783-run-the-cypress-tests-against-the-procaptcha-bundle branch November 21, 2023 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants