Maximo Test Automation with Cypress

Maximo Test Automation with Cypress

Cypress.io is a newish front-end test automation tool. In my brief encounter with Cypress, I found it relatively easy to set up and get started. The development workflow from coding to writing tests and running them is refreshingly smooth as compared to other Selenium based tools. Cypress does have its own limitations though as explained here.

Cypress runs inside the browser in the same process as your application. Having direct access to the UI brings speed and other benefits to the testing process.

I wrote a very simple test to create a new Asset in Maximo 7.6. Here is the test script:

Cypress.on('uncaught:exception', (err, runnable) => {
  // returning false here prevents Cypress from
  // failing the test
  return false
})

describe('My First Test', function() {
  it('Visits the Kitchen Sink', function() {
    cy.visit('http://mx7vm/maximo/webclient/login/login.jsp')
	cy.get('#username').type('maxadmin')
	cy.get('#password').type('maxadmin')
	cy.get('#loginbutton').click()
	cy.contains('Assets').trigger('mouseover')
	cy.contains('Assets').click()
	cy.contains('New Asset').click()
	cy.get('#m73f28d7-tb').type('ABC' + new Date().getMilliseconds())
	cy.get('#md209854a-tb').type('ABC-1000-XYZ')
	cy.get('#m73f28d7-tb2').type('Asset created through Test Automation')
	cy.contains('Save Asset').click()
	cy.get('#titlebar_hyperlink_8-lbsignout_image').click()
  })
})

If there is an uncaught exception in the browser code, then by default the test will fail. This was one of the issues I faced as there was an exception in the browser on clicking ‘New Asset’ action in Maximo. The first few lines of the test script, take care of this by continuing with the test script even in case of an uncaught exception.

Here is the video recording of Maximo automated with Cypress running the above script.

One Reply to “Maximo Test Automation with Cypress”

Leave a Reply

Your email address will not be published.