pramam / webdriverio-saucedemo-testing

Front end testing using finite state machines
https://pramam.github.io/webdriverio-saucedemo-testing/
1 stars 2 forks source link

#items in cart not matching expected value for 'problem_user' #6

Open pramam opened 2 years ago

pramam commented 2 years ago

Bug found in automated tests on branch3-continueworking This branch was not submitted in the pull request.

User Account: problem_user Likely related to issue #3.

In various tests cases, after adding X number of items to cart, it is found that the Cart Icon on top is showing a different number of items. Test cases that reproduce this (on branch3-continueworking): TestCase_3: Added 3 items to cart. Expectation: To find 3 times in cart. Actual: Found 2 items in cart. Line in code that shows the error:


Error: CartPage.checkNumCartItems: has 2 expecting 3
                    at CartPage.checkNumCartItems (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\pageobjects\cart.page.js:36:19)
                    at processTicksAndRejections (internal/process/task_queues.js:93:5)
                    at async Context.<anonymous> (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\specs\checkout3.e2e.js:37:9)```

***TestCase_5***: 
Added 5 items to cart
_Expectation_: To find 5 items in cart
_Actual_: Found 3 items in cart
[Line in code](https://github.com/pramam/sdet-candidate-ui-pallavi/blob/b719c4c38c988640d9ad8f86ddcc4a43449d30c7/test/specs/checkout5.e2e.js#L37) that shows the error:
                           ```CartPage.checkNumCartItems: has 3 expecting 5
Error: CartPage.checkNumCartItems: has 3 expecting 5
                    at CartPage.checkNumCartItems (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\pageobjects\cart.page.js:36:19)
                    at processTicksAndRejections (internal/process/task_queues.js:93:5)
                    at async Context.<anonymous> (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\specs\checkout5.e2e.js:37:9)```

***TestCase_6***:
Added 3 items to cart.
_Expectation_: To find 3 items in cart
_Actual_: Found 1 item in cart
[Line in code](https://github.com/pramam/sdet-candidate-ui-pallavi/blob/b719c4c38c988640d9ad8f86ddcc4a43449d30c7/test/specs/checkout6.e2e.js#L36) that shows the error:

```CartPage.checkNumCartItems: has 1 expecting 3
Error: CartPage.checkNumCartItems: has 1 expecting 3
                    at CartPage.checkNumCartItems (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\pageobjects\cart.page.js:36:19)
                    at processTicksAndRejections (internal/process/task_queues.js:93:5)
                    at async Context.<anonymous> (C:\pallavi\code\webdriverio\sdet-candidate-ui-pallavi-2\test\specs\checkout6.e2e.js:36:9)```
pramam commented 2 years ago

On manual testing as problem_user, the cart count was checked. +1 means cart count is updated on clicking 'Add To Cart'. +0 means it did not update cart count as expected.

Cart Count | id of item -- | -- +1 | add-to-cart-sauce-labs-backpack +1 | add-to-cart-sauce-labs-bike-light +0 | add-to-cart-sauce-labs-bolt-t-shirt +0 | add-to-cart-sauce-labs-fleece-jacket +1 | add-to-cart-sauce-labs-onesie +0 | add-to-cart-test.allthethings()-t-shirt-(red)