Este proyecto es un conjunto de suites de pruebas automatizadas basado en el patrón de diseño Page Object Model (POM). Está diseñado para probar las funcionalidades de una tienda virtual, enfocándose en diferentes aspectos como las interacciones de usuario, la navegación de productos y los procesos de pago, entre otros. Para su desarrollo he utilizado 'Pycharm' y utilizan pytest para su ejecución y allure para la visualización de sus resultados.
- Diseño basado en Page Object Model (POM): Cada página web está representada por una clase que encapsula sus elementos e interacciones. De esta manera logramos un código más limpio, así como una buena reutilización y un mejor mantenimiento del mismo.
- Cobertura de Pruebas Integral: Incluye pruebas para acciones de usuario, gestión de productos, proceso de pago, y diversas funcionalidades del sitio.
- Generación de Datos: Utiliza un generador de datos de prueba que usa la librería 'Fake' bajo un 'Patrón Singleton', asegurando que sólo haya una instancia de la clase Datos durante la ejecución.
- Configuración y Utilidades: Archivos de configuración y utilidades adicionales para facilitar las pruebas.
- Resultados de Test: Utiliza Allure para mostrar y guardar los resultados de las pruebas, con pasos y marcadores según los principales Funcionalidades e Historias de Usuario relacionadas.
POM_Automation_Exercise/
├── conftest.py # Configuración de pytest
├── pages/ # Clases de páginas que siguen el patrón POM
│ ├── page_base.py
│ ├── page_carrito.py
│ ├── page_checkout.py
│ ├── page_contacto.py
│ ├── page_cuenta_borrada.py
│ ├── page_cuenta_creada.py
│ ├── page_detalles_producto.py
│ ├── page_envio.py
│ ├── page_header_footer.py
│ ├── page_home.py
│ ├── page_login_registro.py
│ ├── page_pago.py
│ ├── page_productos.py
│ ├── page_registro.py
│ └── page_test_cases.py
├── tests/ # Suites de pruebas
│ ├── test_base.py
│ ├── test_suite_checkout.py
│ ├── test_suite_navegacion_scroll.py
│ ├── test_suite_productos.py
│ ├── test_suite_support.py
│ ├── test_suite_suscripcion.py
│ └── test_suite_usuario.py
├── utils/ # Utilidades adicionales
│ ├── generador_datos.py
│ └── urls.py
└── Tabla Organización Test Cases.xlsx # Documento de organización de casos de prueba
test_suite_checkout.py: Pruebas relacionadas con el proceso de pago, incluyendo verificación de precios, envío, y confirmación de pedido.test_suite_navegacion_scroll.py: Pruebas de navegación y desplazamiento en la página, asegurando que los elementos son accesibles y visibles.test_suite_productos.py: Pruebas de la gestión de productos, como la visualización de detalles, adición al carrito, y categorías de productos.test_suite_support.py: Pruebas de las funcionalidades de soporte y contacto, verificando el envío y la recepción de mensajes.test_suite_suscripcion.py: Pruebas de las funcionalidades de suscripción a newsletters y notificaciones.test_suite_usuario.py: Pruebas relacionadas con la gestión de cuentas de usuario, como registro, inicio de sesión, y eliminación de cuentas.
-
Instalar Dependencias: Las dependencias están en el archivo 'requirements.txt'. Asegúrate de tenerlas instaladas.
pip install -r requirements.txt
-
Ejecutar las Pruebas: Navega al directorio del proyecto y ejecuta las pruebas.
pytest --alluredir=./allure/resultados/<nombre_archivo_resultados>
-
Visualizar los resultados de las pruebas
allure serve ./allure/resultados/<nombre_archivo_resultados>
✅Test Case 1: Register User
- Launch browser
- Navigate to url 'http://automationexercise.com' 3.Verify that home page is visible successfully
- Click on 'Signup / Login' button
- Verify 'New User Signup!' is visible
- Enter name and email address
- Click 'Signup' button 8.Verify that 'ENTER ACCOUNT INFORMATION' is visible
- Fill details: Title, Name, Email, Password, Date of birth
- Select checkbox 'Sign up for our newsletter!'
- Select checkbox 'Receive special offers from our partners!'
- Fill details: First name, Last name, Company, Address, Address2, Country, State, City, Zipcode, Mobile Number
- Click 'Create Account button' 14.Verify that 'ACCOUNT CREATED!' is visible
- Click 'Continue' button 16.Verify that 'Logged in as username' is visible
- Click 'Delete Account' button 18.Verify that 'ACCOUNT DELETED!' is visible and click 'Continue' button
✅Test Case 2: Login User with correct email and password
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Signup / Login' button
- Verify 'Login to your account' is visible
- Enter correct email address and password
- Click 'login' button
- Verify that 'Logged in as username' is visible
- Click 'Delete Account' button
- Verify that 'ACCOUNT DELETED!' is visible
✅Test Case 3: Login User with incorrect email and password
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Signup / Login' button
- Verify 'Login to your account' is visible
- Enter incorrect email address and password
- Click 'login' button
- Verify error 'Your email or password is incorrect!' is visible
✅Test Case 4: Logout User
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Signup / Login' button
- Verify 'Login to your account' is visible
- Enter correct email address and password
- Click 'login' button
- Verify that 'Logged in as username' is visible
- Click 'Logout' button
- Verify that user is navigated to login page
✅Test Case 5: Register User with existing email
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Signup / Login' button
- Verify 'New User Signup!' is visible
- Enter name and already registered email address
- Click 'Signup' button
- Verify error 'Email Address already exist!' is visible
✅Test Case 6: Contact Us Form
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Contact Us' button
- Verify 'GET IN TOUCH' is visible
- Enter name, email, subject and message
- Upload file
- Click 'Submit' button
- Click OK button
- Verify success message 'Success! Your details have been submitted successfully.' is visible
- Click 'Home' button and verify that landed to home page successfully
✅Test Case 8: Verify All Products and product detail page
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Products' button
- Verify user is navigated to ALL PRODUCTS page successfully
- The products list is visible
- Click on 'View Product' of first product
- User is landed to product detail page
- Verify that detail detail is visible: product name, category, price, availability, condition, brand
✅Test Case 9: Search Product
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click on 'Products' button
- Verify user is navigated to ALL PRODUCTS page successfully
- Enter product name in search input and click search button
- Verify 'SEARCHED PRODUCTS' is visible
- Verify all the products related to search are visible
✅Test Case 10: Verify Subscription in home page
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Scroll down to footer
- Verify text 'SUBSCRIPTION'
- Enter email address in input and click arrow button
- Verify success message 'You have been successfully subscribed!' is visible
✅Test Case 10: Verify Subscription in home page
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Scroll down to footer
- Verify text 'SUBSCRIPTION'
- Enter email address in input and click arrow button
- Verify success message 'You have been successfully subscribed!' is visible
✅Test Case 11: Verify Subscription in Cart page
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'Cart' button and scroll down to footer
- Verify text 'SUBSCRIPTION'
- Enter email address in input and click arrow button
- Verify success message 'You have been successfully subscribed!' is visible
✅Test Case 12: Add Products in Cart
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'Products' button
- Hover over first product and click 'Add to cart'
- Click 'Continue Shopping' button
- Hover over second product and click 'Add to cart'
- Click 'View Cart' button
- Verify both products are added to Cart
- Verify their prices, quantity and total price
✅Test Case 13: Verify Product quantity in Cart
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'View Product' for any product on home page
- Verify product detail is opened
- Increase quantity to 4
- Click 'Add to cart' button
- Click 'View Cart' button
- Verify that product is displayed in cart page with exact quantity
✅Test Case 14: Place Order: Register while Checkout
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click Proceed To Checkout
- Click 'Register / Login' button
- Fill all details in Signup and create account
- Verify 'ACCOUNT CREATED!' and click 'Continue' button
- Verify 'Logged in as username' at top
- Click 'Cart' button
- Click 'Proceed To Checkout' button
- Verify Address Details and Review Your Order
- Enter description in comment text area and click 'Place Order'
- Enter payment details: Name on Card, Card Number, CVC, Expiration date
- Click 'Pay and Confirm Order' button
- Verify success message 'Congratulations! Your order has been confirmed!'
- Click 'Delete Account' button
- Verify 'ACCOUNT DELETED!' and click 'Continue' button
✅Test Case 15: Place Order: Register before Checkout
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'Signup / Login' button
- Fill all details in Signup and create account
- Verify 'ACCOUNT CREATED!' and click 'Continue' button
- Verify 'Logged in as username' at top
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click Proceed To Checkout
- Verify Address Details and Review Your Order
- Enter description in comment text area and click 'Place Order'
- Enter payment details: Name on Card, Card Number, CVC, Expiration date
- Click 'Pay and Confirm Order' button
- Verify success message 'Congratulations! Your order has been confirmed!'
- Click 'Delete Account' button
- Verify that 'ACCOUNT DELETED!' and click 'Continue' button
✅Test Case 16: Place Order: Login before Checkout
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'Signup / Login' button
- Fill email, password and click 'Login' button
- Verify 'Logged in as username' at top
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click Proceed To Checkout
- Verify Address Details and Review Your Order
- Enter description in comment text area and click 'Place Order'
- Enter payment details: Name on Card, Card Number, CVC, Expiration date
- Click 'Pay and Confirm Order' button
- Verify success message 'Congratulations! Your order has been confirmed!'
✅Test Case 17: Remove Products From Cart
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click 'X' button corresponding to particular product
- Verify that product is removed from the cart
✅Test Case 18: View Category Products
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that categories are visible on left side bar
- Click on 'Women' category
- Click on any category link under 'Women' category, for example: Dress
- Verify that category page is displayed and confirm text 'WOMEN - DRESS PRODUCTS'
- On left side bar, click on any sub-category link of 'Men' category
- Verify that user is navigated to that category page
✅Test Case 19: View & Cart Brand Products
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Click on 'Products' button
- Verify that Brands are visible on left side bar
- Click on any brand name
- Verify that user is navigated to brand page and brand products are displayed
- On left side bar, click on any other brand link
- Verify that user is navigated to that brand page and can see products
✅Test Case 20: Search Products and Verify Cart After Login
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Click on 'Products' button
- Verify user is navigated to ALL PRODUCTS page successfully
- Enter product name in search input and click search button
- Verify 'SEARCHED PRODUCTS' is visible
- Verify all the products related to search are visible
- Add those products to cart
- Click 'Cart' button and verify that products are visible in cart
- Click 'Signup / Login' button and submit login details
- Again, go to Cart page
- Verify that those products are visible in cart after login as well
- Remove all products that have been added
- Verify 'Cart is empty! Click here to buy products.' is visible
✅Test Case 21: Add review on product
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Click on 'Products' button
- Verify user is navigated to ALL PRODUCTS page successfully
- Click on 'View Product' button
- Verify 'Write Your Review' is visible
- Enter name, email and review
- Click 'Submit' button
- Verify success message 'Thank you for your review.'
✅Test Case 22: Add to cart from Recommended items
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Scroll to bottom of page
- Verify 'RECOMMENDED ITEMS' are visible
- Click on 'Add To Cart' on Recommended product
- Click on 'View Cart' button
- Verify that product is displayed in cart page
✅Test Case 23: Verify address details in checkout page
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Click 'Signup / Login' button
- Fill all details in Signup and create account
- Verify 'ACCOUNT CREATED!' and click 'Continue' button
- Verify 'Logged in as username' at top
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click Proceed To Checkout
- Verify that the delivery address and the billing address are the same address filled at the time of account registration
- Click 'Delete Account' button
- Verify 'ACCOUNT DELETED!' and click 'Continue' button
✅Test Case 24: Download Invoice after purchase order
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Add products to cart
- Click 'Cart' button
- Verify that cart page is displayed
- Click Proceed To Checkout
- Click 'Register / Login' button
- Fill all details in Signup and create account
- Verify 'ACCOUNT CREATED!' and click 'Continue' button
- Verify 'Logged in as username' at top
- Click 'Cart' button
- Click 'Proceed To Checkout' button
- Verify Address Details and Review Your Order
- Enter description in comment text area and click 'Place Order'
- Enter payment details: Name on Card, Card Number, CVC, Expiration date
- Click 'Pay and Confirm Order' button
- Verify success message 'Congratulations! Your order has been confirmed!'
- Click 'Download Invoice' button and verify invoice is downloaded successfully
- Click 'Continue' button
- Click 'Delete Account' button
- Verify 'ACCOUNT DELETED!' and click 'Continue' button
✅Test Case 25: Verify Scroll Up using 'Arrow' button and Scroll Down functionality
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Scroll down page to bottom
- Verify 'SUBSCRIPTION' is visible
- Click on arrow at bottom right side to move upward
- Verify that page is scrolled up and 'Full-Fledged practice website for Automation Engineers' text is visible on screen
✅Test Case 26: Verify Scroll Up without 'Arrow' button and Scroll Down functionality
- Launch browser
- Navigate to url 'http://automationexercise.com'
- Verify that home page is visible successfully
- Scroll down page to bottom
- Verify 'SUBSCRIPTION' is visible
- Scroll up page to top
- Verify that page is scrolled up and 'Full-Fledged practice website for Automation Engineers' text is visible on screen








