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

BE-17318 e2e for Boost a Non Music Post #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

DivyaMoryani
Copy link
Collaborator

BE-17318 e2e for Boost a Non Music Post

Added a Test Case for Boost a Post.
Tested It Locally:

image

@stereohorse
Copy link
Collaborator

stereohorse commented Feb 8, 2024

Hi @DivyaMoryani , thanks for the PR!
Is there any business scenario description, just to have more context of SUT?

@stereohorse
Copy link
Collaborator

From Slack, just for convenience: https://bandlab.atlassian.net/wiki/spaces/QA/pages/2698313926/Boost+Campaigns+Feature#Boost-Posts
Sorry for the review delay :(

tests/e2eTestForBoost/step-definitions/boost.steps.js Outdated Show resolved Hide resolved
await boostPage.setBudgetAndDuration();
})

When (/^Complete the Boost payment process$/,async function (){
When(/^I complete the Boost payment process$/,async function (){
await helpers.waitForTimeout(page,5000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if we need this timeout too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @aabrosimov-bl , i observed one thing for UI automation unlike API response which has a stable response time unless the API is heavy , the tests are very flaky... it needs some timeout for some tests otherwise its too fast, resulting in failure, Ive executed a couple of times & its uncertain when it passes/fails, so I added a delay where the tests were failing more often.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future we should look for UI cues to indicate certain events instead of just using delays, because constant delays are always at a risk of being insufficient during service slowdowns etc., but that would be much more complex, so for now it's OK.

tests/e2eTestForBoost/step-definitions/boost.steps.js Outdated Show resolved Hide resolved
tests/e2eTestForBoost/step-definitions/boost.steps.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@stereohorse stereohorse left a comment

Choose a reason for hiding this comment

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

Hi @DivyaMoryani, I've left some comments.
Great work! And sorry again for the late review.

tests/e2eTestForBoost/features/desktop/boostPost.feature Outdated Show resolved Hide resolved
tests/e2eTestForBoost/features/desktop/boostPost.feature Outdated Show resolved Hide resolved
tests/e2eTestForBoost/pages/feeds.js Outdated Show resolved Hide resolved
await campaignDashboardPage.campaignDashBoardButton();
})

Then (/^Boost Post Campaign is returned should be returned in the Campaign Dashboard$/,async function (){
Then(/^Boost Post campaign is returned should be returned in the Campaign Dashboard$/,async function (){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to receive a Boost Post campaign from a parallel/previous test?
If yes, is there any way to ensure, that we are verifying boost of the specific post, created in this test by the earlier step?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was trying to find some x-path for this, but then it got super complicated, then I realised that the Boost locator will always click the first button which is always the post we created in Step 1 "Create a text post" , if that fails all tests will stop. So going with the simple logic for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean, is it possible to fail on boosting a post, but still pass the Boost Post campaign is returned should be returned in the Campaign Dashboard check because we have already a boosted post(for example, from the previous test run on the same account)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the review @stereohorse , yes to avoid this case to pass the "Boost Post campaign is returned should be returned in the Campaign Dashboard" step, What I did now is:

  1. Created a Text post with a Random test so everytime we have a unique post
  2. In Campaign Dashboard step - it will check for that unique post & pass/fail accordingly

Hope this makes sense :)

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.

None yet

3 participants