strapi/tests/helpers/test-app.js

102 lines
2.7 KiB
JavaScript
Raw Permalink Normal View History

test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
'use strict';
const path = require('path');
const fs = require('fs');
2024-03-27 15:21:38 +01:00
const { rimraf } = require('rimraf');
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
const execa = require('execa');
const { createStrapi } = require('create-strapi-app');
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
/**
* Deletes a test app
* @param {string} appPath - name of the app / folder where the app is located
*/
2024-03-27 15:21:38 +01:00
const cleanTestApp = async (appPath) => {
await rimraf(path.resolve(appPath));
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
};
/**
* Runs strapi generate new
* @param {Object} options - Options
* @param {string} options.appPath - Name of the app that will be created (also the name of the folder)
* @param {database} options.database - Arguments to create the testApp with the provided database params
*/
const generateTestApp = async ({ appPath, database, template, link = false }) => {
2024-05-02 14:38:49 +02:00
const pkg = require(path.resolve(__dirname, '../../packages/core/strapi/package.json'));
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
const scope = {
database,
rootPath: path.resolve(appPath),
name: path.basename(appPath),
2024-05-31 09:18:57 +02:00
packageManager: 'yarn',
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
// disable quickstart run app after creation
2024-05-02 14:38:49 +02:00
runApp: false,
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
// use package version as strapiVersion (all packages have the same version);
2024-05-02 14:38:49 +02:00
strapiVersion: pkg.version,
2024-05-31 09:18:57 +02:00
isQuickstart: false,
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
uuid: undefined,
deviceId: null,
installDependencies: false,
2024-05-31 09:18:57 +02:00
dependencies: {
2024-05-02 14:38:49 +02:00
'@strapi/strapi': pkg.version,
'@strapi/plugin-users-permissions': pkg.version,
'@strapi/plugin-graphql': pkg.version,
'@strapi/plugin-documentation': pkg.version,
'@strapi/plugin-cloud': pkg.version,
react: '18.2.0',
'react-dom': '18.2.0',
'react-router-dom': '^6.0.0',
'styled-components': '^6.0.0',
},
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
template: template ? path.resolve(template) : template,
2024-08-26 15:37:24 +02:00
gitInit: false,
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
};
await createStrapi(scope);
if (link) {
2023-12-01 11:30:16 +01:00
await linkPackages(scope);
}
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
};
2023-12-01 11:30:16 +01:00
const linkPackages = async (scope) => {
fs.writeFileSync(path.join(scope.rootPath, 'yarn.lock'), '');
await execa('node', [path.join(__dirname, '../..', 'scripts', 'yalc-link.js')], {
cwd: scope.rootPath,
stdio: 'inherit',
});
test: add e2e tooling Remove old cypress related files Update config and reorg tests Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends init deits fix: e2e test chore: rename to e2e chore: commit tar for data Init playwright Run test app before running playwright tests feat: add beginning of authentication test feat: add app template with database dumping ability chore: pr amends chore: remove unneeded workflow fix: add private: true to the template so `test-apps` aren't published docs: add docs chore: add warning about DTS caveats chore: tweak docs docs(e2e): add correct route to api example for template chore: fix package.json tests chore: update from feature/DEITS chore: updates from DTS chore: update data-transfer Update yarn.lock fix: remove duplicate type chore(e2e): set up folder structure fix(e2e): avoid clearing 'admin_' DB tables through DTS or DB Dump feat(e2e): DTS scripts and backup files add route to change rate limit fix wront appPath for API test in CI no template by default when creating a test app Fix typo double equal fix template path for e2e tests chore(e2e): fix broken signup spec feat(e2e): basic logout test spec Login e2e tests globalSetup attempt use withAdmin backup cleanup fix playwright config & rate limit test remove example.spec.js refactor and merge some login tests Chore: Cleanup login and signup specs feat(e2e): sign up password error cases feat(e2e): add homepage expectation to signup spec refactor(e2e) refactor(e2e): signUp refactor(e2e): use global login util for logout and logins specs Init playwright fix: remove duplicate type chore: uncomment transfer route registering Update yarn.lock chore: update data-transfer chore: updates from DTS chore: update from feature/DEITS chore: fix package.json tests docs(e2e): add correct route to api example for template chore: tweak docs chore: add warning about DTS caveats docs: add docs fix: add private: true to the template so `test-apps` aren't published chore: remove unneeded workflow chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Init playwright chore: commit tar for data chore: rename to e2e fix: e2e test init deits chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests chore: pr amends feat: add app template with database dumping ability feat: add beginning of authentication test Run test app before running playwright tests Update config and reorg tests Remove old cypress related files chore(e2e): cleanup e2e dir chore(docs): improve e2e testing documentation chore(docs): PR feedback chore: tweak action to run browsers in matrix & build packages chore: fix tests based on merge chore: shuffle e2e tests and add first conent-type fix: tests Make use of yarn linking for api & e2e tests Chore: Fix running backend unit tests Chore: Bring opts.run back Chore: Update playwright Chore: Update Playwright setup fix: workflow chore: fix path to package.json chore: build ts projects before tests chore: update e2e workflow chore: add no-immutable Use simpler transfer token to avoid misinterpretation Remove console.log Ensure that the custom transfer token exists in the e2e test app's database upon startup Use the custom transfer token for transferring data to the e2e test app Fix code analysis warning Define and export a constant for the custom transfer token Allow passing a custom access key for the transfer token service chore: add test-apps to workspace chore: update lockfile Co-Authored-By: Josh <37798644+joshuaellis@users.noreply.github.com> Co-Authored-By: Gustav Hansen <gu@stav.dev> Co-Authored-By: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-Authored-By: Jean-Sébastien Herbaux <25851739+Convly@users.noreply.github.com>
2022-10-28 09:35:21 +02:00
};
/**
* Runs a test app
* @param {string} appPath - name of the app / folder where the app is located
*/
const runTestApp = async (appPath) => {
const cmdContext = {
stdio: 'inherit',
cwd: path.resolve(__dirname, '../..', appPath),
env: {
// if STRAPI_LICENSE is in the env the test will run in ee automatically
STRAPI_DISABLE_EE: !process.env.STRAPI_LICENSE,
FORCE_COLOR: 1,
JWT_SECRET: 'aSecret',
},
};
try {
await execa('yarn', ['strapi', 'build'], cmdContext);
await execa('yarn', ['strapi', 'start'], cmdContext);
process.exit(0);
} catch (error) {
console.error(error);
process.exit(1);
}
};
module.exports = {
cleanTestApp,
generateTestApp,
runTestApp,
};