Skip to content

I have problem with test framework(JASMIN) #157

Description

@Dusan94M

My code working when i open Amazon and Checkout, but when is time to do testing with Jasmin, i have a problem... I have to do sam changes in my code and after that is fine with Jamin...
Then i have problem when i open Amazon and Checkout :D
Image
Image
Image

Activity

  1. kenshih1989 commented on Apr 16, 2025

    @kenshih1989

    From the last screenshot provided,
    it told us that the AddToCart function from cart.js was throwing error (line#28).
    Mind share the AddToCart function from cart.js here to further troubleshoot or discuss?

  2. u4dara commented on Jun 18, 2025

    @u4dara

    Probably, you have updated the code to get the selected value from the dropdown menu, rather than adding 1 item each time an item is added to the cart.

    Previous:
    Image

    If that's the case. The 'value' mentioned in the errors should be this value property.

    Therefore, you have to edit the code a little bit so as not to accidentally take null or undefined values using a 'Default Operator'.
    As in a situation like testing, we don't get the quantity from a dropdown menu. We are just adding an item using only the product ID.

    After:
    Image

    Check whether the value is falsy. If so, assign a default value.

    After refactoring the code, your test cases should pass without error.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions