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

feat(e2e): test la validité de l'html de toutes les pages contributions et convention-collectives #5686

Merged
merged 44 commits into from
Jun 25, 2024

Conversation

carolineBda
Copy link
Contributor

@carolineBda carolineBda commented Mar 11, 2024

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@@ -10,13 +11,17 @@ module.exports = defineConfig({
baseUrl: process.env.TEST_BASEURL ?? "http://localhost:3000",
specPattern: process.env.ALL_TEST
? "cypress/integration/**/*.spec.{js,jsx,ts,tsx}"
: "cypress/integration/light/*.spec.{js,jsx,ts,tsx}",
: "cypress/integration/heavy/validate-html.spec.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ à ne surtout pas committer c'est juste pour tester la spec qui est dans heavy

@carolineBda carolineBda marked this pull request as draft March 12, 2024 14:52
});
});

const FILE_SIZE = Math.floor(urlsContributions.length / 2) + 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je créé 2 fichiers avec chacun la moitié des urls pour les runner dans 2 tests séparés sinon c'est vraiment trop long

@@ -0,0 +1 @@
[]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const urls: string[] = ["/convention-collective", "/contribution"];

const response = await fetch(
"https://code-du-travail-numerique-preprod.ovh.fabrique.social.gouv.fr/api/plan-du-site"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ici si je mets ${SITE_URL}/api/plan-du-site j'ai une erreur parce que cette variable n'est pas rensigné

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essaye : process.env.TEST_BASEURL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai cette erreur sur process :
TS2591: Cannot find name process. Do you need to install type definitions for node? Try npm i --save-dev @types/node and then add node to the types field in your tsconfig.

@carolineBda carolineBda marked this pull request as ready for review June 20, 2024 16:04
Copy link
Member

@maxgfr maxgfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top ! On teste bien tout

Si on peut créer l'échantillon gratuit sur la partie light

Comment on lines 24 to 26
console.log(
"Urls à valider sauvegardées dans le fichier ./cypress/support/urls-to-validate.json"
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à clean

Comment on lines 47 to 49
console.log(
`Urls des contributions à valider sauvegardées dans les fichier "./cypress/support/urls-contributions-to-validate-1.json" et "./cypress/support/urls-contributions-to-validate-2.json"`
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ici aussi

const urls: string[] = ["/convention-collective", "/contribution"];

const response = await fetch(
"https://code-du-travail-numerique-preprod.ovh.fabrique.social.gouv.fr/api/plan-du-site"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essaye : process.env.TEST_BASEURL

maxgfr
maxgfr approved these changes Jun 24, 2024
@carolineBda carolineBda merged commit d91c95c into dev Jun 25, 2024
22 checks passed
@carolineBda carolineBda deleted the carolineBda/e2e-html-validity branch June 25, 2024 12:47
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.

Tester la validité de l'html sur toutes les pages
5 participants