brotherton-erpnext/cypress/integration/opportunity/lost_reason_detail.js

32 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-12-31 10:54:46 +00:00
context('Form', () => {
before(() => {
cy.login('Administrator', 'qwe');
cy.visit('/desk');
});
it('create a new opportunity', () => {
cy.visit('/desk#Form/Opportunity/New Opportunity 1');
cy.get('.page-title').should('contain', 'Not Saved');
cy.fill_field('opportunity_from', 'Customer', 'Select');
cy.fill_field('party_name', 'Test Customer', 'Link').blur();
2018-12-31 10:54:46 +00:00
cy.get('.primary-action').click();
cy.get('.page-title').should('contain', 'Open');
cy.get('.form-inner-toolbar button:contains("Lost")').click({ force: true });
2019-01-02 08:29:42 +00:00
cy.get('.modal input[data-fieldname="lost_reason"]').as('input');
cy.get('@input').focus().type('Higher', { delay: 200 });
2018-12-31 10:54:46 +00:00
cy.get('.modal .awesomplete ul')
.should('be.visible')
.get('li:contains("Higher Price")')
2019-01-02 08:29:42 +00:00
.click({ force: true });
cy.get('@input').focus().type('No Followup', { delay: 200 });
2018-12-31 10:54:46 +00:00
cy.get('.modal .awesomplete ul')
.should('be.visible')
.get('li:contains("No Followup")')
2019-01-02 08:29:42 +00:00
.click();
2018-12-31 10:54:46 +00:00
cy.fill_field('detailed_reason', 'Test Detailed Reason', 'Text');
cy.get('.modal button:contains("Declare Lost")').click({ force: true });
cy.get('.page-title').should('contain', 'Lost');
});
});