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

Fix tests on next #504

Draft
wants to merge 6 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,927 changes: 16,837 additions & 14,090 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions playground/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ HOST=0.0.0.0
PORT=1337
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
TRANSFER_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
DEEPL_API_KEY=tobemodified
Expand Down
1 change: 1 addition & 0 deletions playground/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ HOST=0.0.0.0
PORT=1337
APP_KEYS="toBeModified1,toBeModified2"
API_TOKEN_SALT=tobemodified
TRANSFER_TOKEN_SALT=tobemodified
ADMIN_JWT_SECRET=tobemodified
JWT_SECRET=tobemodified
TRANSLATE_PROVIDER=dummy
Expand Down
1 change: 1 addition & 0 deletions playground/config/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = ({ env }) => ({
apiToken: {
salt: env('API_TOKEN_SALT'),
},
transfer: { token: { salt: env('TRANSFER_TOKEN_SALT') } },
rateLimit: {
enabled: false,
},
Expand Down
15 changes: 15 additions & 0 deletions playground/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Cypress.Commands.add('login', () => {
)
},
})
verifyAdminPageHasLoaded()
})
})
//
Expand All @@ -41,3 +42,17 @@ Cypress.Commands.add('login', () => {
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

function verifyAdminPageHasLoaded(maxAttempts = 3, attempts = 0) {
if (attempts > maxAttempts) {
throw new Error('Timed out waiting for admin page to load correctly')
}
cy.wait(5000)
.get('body')
.then(($body) => {
if (!$body.find('h1').length) {
cy.reload(true)
verifyAdminPageHasLoaded(maxAttempts, attempts + 1)
}
})
}
6 changes: 3 additions & 3 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"test": "echo no unittests"
},
"dependencies": {
"@strapi/plugin-users-permissions": "5.7.0",
"@strapi/strapi": "5.7.0",
"@strapi/plugin-users-permissions": "^5.8.0",
"@strapi/strapi": "^5.8.0",
"better-sqlite3": "9.4.0",
"dotenv": "^16.4.1",
"lodash": "^4.17.21",
Expand All @@ -34,7 +34,7 @@
"styled-components": "^6.0.0"
},
"devDependencies": {
"cypress": "^13.6.4",
"cypress": "14.0.2",
"start-server-and-test": "^2.0.3"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion playground/templates/template.package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"styled-components": "^6.0.0"
},
"devDependencies": {
"cypress": "^13.6.4",
"cypress": "14.0.2",
"start-server-and-test": "^2.0.3"
},
"engines": {
Expand Down
Loading
Loading