Open Slawomir-DKl opened 1 month ago
Additionally, I've set the article-labels tests to serial mode to avoid flaky tests - in parallel mode, the "200" test sometimes fails with "404" code, probably due to other tests working concomitantly on the same articles or other resources
Resolves #108
Scope of changes:
feature-file.helper.ts
)data
key in the request functionHow to use it:
New helper
feature-file.helper.ts
I propose using the new helper function in hook beforeAll and disabling it in hook afterAll. To use the function, pass the
request
parameter as the context, the name of the flag (to be checked in GAD documentation) and booleanisEnabled
(true
if you want to enable the flag andfalse
to disable it), e.g.await enableFeatureFlag(request, 'feature_validate_article_title', true);
Article title generator
At the moment you can:
request
parameter as the contextFaker
First install the faker library:
npm i @faker-js/faker
To use the faker, import it (I suggest importing only EN version to improve test performance):
import {faker } from '@faker-js/faker/locale/en'
Any other comments?
In the
generateUniqueArticleTitle
function, I used the while loop with if condition. Remarks:while
loop, but I didn't enter any measures to stop the loop e.g. after 50 unsuccessful iterations (I think the chances are to small to make such fuses)Returns 422 status code when updating the article with the title equal to another article title
with enabled flag inarticle-id-put.spec.ts
) when all the tests are fired at once. At the moment I haven't discovered the problemBefore submitting Pull Request, I've ensured that:
kawqa-gad-playwright
project's git commit message format.