# Admin: create a product (one item variant) so the user app can order it. # # ProductForm has no testIDs, so fields are addressed by their label/placeholder: # "Enter product name" -> name (must be globally unique) # "Selling price" -> Our Price (must be > 0) # "e.g. 0.5 kg" -> quantity feature value (required) # Store and Product Type are pre-filled ("1" / "Item"), and images are optional, # so nothing else is needed for a valid save. # # Env (see e2e/run.sh): ADMIN_NAME, ADMIN_PASSWORD, PRODUCT_NAME, PRODUCT_PRICE appId: in.freshyo.adminui --- - launchApp: clearState: false - runFlow: ../subflows/dismiss-dev-toast.yaml - runFlow: ../subflows/admin-login.yaml - extendedWaitUntil: visible: "Dashboard" timeout: 90000 # --- Dashboard quick action -> product form --------------------------------- - tapOn: "Add Product" # The form is long, so anchor on its first field (the submit button is far below # the fold and would fail an assertVisible). - extendedWaitUntil: visible: "Enter product name" timeout: 60000 # --- Required fields -------------------------------------------------------- - tapOn: "Enter product name" - inputText: ${PRODUCT_NAME} - hideKeyboard - scrollUntilVisible: element: text: "Selling price" direction: DOWN centerElement: true timeout: 30000 - tapOn: "Selling price" - inputText: ${PRODUCT_PRICE} - hideKeyboard - scrollUntilVisible: element: text: "e.g. 0.5 kg" direction: DOWN centerElement: true timeout: 30000 - tapOn: "e.g. 0.5 kg" - inputText: "0.5 kg" - hideKeyboard # --- Submit ----------------------------------------------------------------- - scrollUntilVisible: element: text: "Create Product" direction: DOWN centerElement: true timeout: 30000 - runFlow: ../subflows/dismiss-dev-toast.yaml - tapOn: "Create Product" - extendedWaitUntil: visible: "Product created successfully!" timeout: 60000 - tapOn: "OK"