All Projects → borni-dhifi → odoo-cypress

borni-dhifi / odoo-cypress

Licence: other
Odoo Framework E2E Testing using Cypress

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to odoo-cypress

babel-plugin-remove-test-ids
🐠 Babel plugin to strip `data-test-id` HTML attributes
Stars: ✭ 40 (+110.53%)
Mutual labels:  e2e, cypress, e2e-testing
quasar-testing
Testing Harness App Extensions for the Quasar Framework 1.0+
Stars: ✭ 142 (+647.37%)
Mutual labels:  cypress, e2e-testing
cypress-page-object
Represent the screens of your website as a series of objects in your Cypress test suite
Stars: ✭ 23 (+21.05%)
Mutual labels:  e2e, cypress
cypress-plugin-stripe-elements
A small Cypress plugin that assists you in filling in Stripe Elements inputs
Stars: ✭ 22 (+15.79%)
Mutual labels:  cypress, e2e-testing
cypress-maildev
Cypress Maildev is a bunch of Cypress commands in order to test your messages (SMS and Emails) by using Maildev REST API.
Stars: ✭ 19 (+0%)
Mutual labels:  e2e, cypress
cypress-auto-stub-example
Example project to demonstrate how to record/replay API with Cypress.
Stars: ✭ 52 (+173.68%)
Mutual labels:  cypress, e2e-testing
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+210.53%)
Mutual labels:  cypress, e2e-testing
cypress-browser-permissions
A Cypress plugin to set launched browser preferences including permissions like Geolocation, Notifications, Microphone, etc.
Stars: ✭ 40 (+110.53%)
Mutual labels:  e2e, cypress
Recorder
A browser extension that generates Cypress, Playwright and Puppeteer test scripts from your interactions 🖱 ⌨
Stars: ✭ 277 (+1357.89%)
Mutual labels:  e2e, cypress
Cypress
Fast, easy and reliable testing for anything that runs in a browser.
Stars: ✭ 35,145 (+184873.68%)
Mutual labels:  cypress, e2e-testing
cypress-xhr-responses-recording
No description or website provided.
Stars: ✭ 19 (+0%)
Mutual labels:  e2e, cypress
cygger
Boilerplate generator for API Testing from Swagger to Cypress
Stars: ✭ 20 (+5.26%)
Mutual labels:  e2e, cypress
odoo-py3o-report-templates
Sample reports (quotation, PO, picking, invoice...) for report_py3o
Stars: ✭ 25 (+31.58%)
Mutual labels:  odoo
very good performance
Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures 🦄
Stars: ✭ 78 (+310.53%)
Mutual labels:  e2e
cypress-retry
Retry just the failed Cypress.io tests using Cypress module API and AST rewriting
Stars: ✭ 16 (-15.79%)
Mutual labels:  cypress
rma
Odoo for Return Merchandise Authorization (RMA)
Stars: ✭ 68 (+257.89%)
Mutual labels:  odoo
cypress-nextjs-auth0
Cypress commands to support Auth0 and Next.js
Stars: ✭ 56 (+194.74%)
Mutual labels:  cypress
partner-contact
Odoo Partner and Contact related addons
Stars: ✭ 167 (+778.95%)
Mutual labels:  odoo
jest-retry
Jest retry pattern for flaky E2E tests
Stars: ✭ 36 (+89.47%)
Mutual labels:  e2e
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (+94.74%)
Mutual labels:  cypress

Odoo Framework E2E Testing using Cypress

Using odoo-cypress run your Odoo E2E tests on any CI is very simple.

Fast, easy and reliable testing for anything in odoo.

Example

Test Case : Workflow Quotation:

  • Select partner
  • Select first product : CONS_DEL01] Server
  • Check value of unit_price after onchange product
  • Select second product : [CPUi5] Processor Core i5 2.70 Ghz
  • Check value of unit_price after onchange product
  • Save quoation
  • Check the amount_total of Quotation
  • Confirm quoation
  • check state should have 'Sales Order' value

You can do this test case with this code :

it('Quotation',  function(){
   cy.MainMenu('Sales','sale.sale_menu_root')
   cy.SubMenu('Orders','sale.menu_sale_order')
   cy.Button('Create')
   cy.M2O_SetValue('partner_id','Agrolait')
   cy.M2O_SetValue_O2M('order_line','product_id','[CONS_DEL01] Server')
   cy.O2M_CheckValue('order_line',1,'price_unit','35,319.51')
   cy.M2O_SetValue_O2M('order_line','product_id','[CPUi5] Processor Core i5 2.70 Ghz')
   cy.O2M_CheckValue('order_line',2,'price_unit','1,236.18')
   cy.Button('Save')
   cy.CheckValue('amount_total','36,555.69')
   cy.Button('Confirm Sale')
   cy.Waiting(2000)
   cy.State_CheckValue('state','Sales Order')
})

Installation

To use this project locally as a dev dependency for your project:

git clone https://github.com/borni-dhifi/odoo-cypress
cd odoo-cypress
npm install cypress

Run Test

Modify file cypress.env.json with your odoo server param:

    {
     "odoo_url": "http://localhost:8070",
     "database": "cypress2",
     "user": "admin",
     "password": "admin"
    }
##launch the Cypress Test Runner
##in the GUI mode
npm run cy_open
## runs all tests and exits with the total number of
## failures across all tests
npm run cy_run
### runs all tests in specific browser
npm run cy_run_chrome
### sends test results, videos, screenshots
### to Cypress dashboard
npm run cy_run_record

Write tests

To write your tests just edit the file odoo-cypress/cypress/integration/odoo_spec.js and add your tests case :

it('Your Test Case 1',  function(){ 
   //...
}) 

it('Your Test Case 2',  function(){ 
   //...
}) 

or you can create new file odoo-cypress/cypress/integration/your_file_name.js and write your tests.

describe('Test Invoice Workflow', function(){
  context('Invoice', function(){ 
    it('Create and validate invoice', function(){ 
     //..
   })
  })
})

Continuous Integration

Running your Odoo E2E tests on any CI is very simple : Jenkins, TravisCI, CircleCI, GitLab .... is the same as running it locally.

  • Travis

Example .travis.yml config file

script:
  - cypress run --record
  • CircleCI

Example circle.yml config file

test:
  override:
    - cypress run --record
  • Gitlab

Example .gitlab-ci.yml file

image: cypress/base
cypress-e2e:
  script:
    - npm install
    - $(npm bin)/cypress run
  • Docker

For Docker You can either start with a base image or with an image that already includes Cypress tool.

Use the official image cypress/base. A typical Dockerfile would look like this:

FROM cypress/base
RUN npm install
RUN $(npm bin)/cypress run

Recording Tests in CI

Tou can record your tests running and make them available in Cypress Dashboard

Todo

  • Improve the waiting method.
  • Add more methods for framework .
  • I think is better to remove XML_ID from MainMenu/SubMenu

Ressources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].