feat: test cases for webform
This commit is contained in:
parent
ae363d9df2
commit
b020b865ba
2 changed files with 36 additions and 0 deletions
29
cypress/integration/web_form.js
Normal file
29
cypress/integration/web_form.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
context('Web Form', () => {
|
||||
before(() => {
|
||||
cy.login('Administrator', 'frappe')
|
||||
});
|
||||
|
||||
it('Navigate and Submit a WebForm', () => {
|
||||
cy.visit('/update-profile');
|
||||
cy.get_field('last_name', 'Data').type('_Test User', {force: true}).wait(200);
|
||||
cy.get('.web-form-actions .btn-primary').click();
|
||||
cy.wait(500);
|
||||
cy.get('.modal.show > .modal-dialog').should('be.visible');
|
||||
});
|
||||
|
||||
it('Timeline should have submit and cancel activity information', () => {
|
||||
cy.call('frappe.tests.ui_test_helpers.update_webform_to_multistep').then(r => {
|
||||
cy.visit('/update-profile');
|
||||
cy.get_field('last_name', 'Data').type('_Test User', {force: true}).wait(200);
|
||||
cy.get('.btn-next').should('be.visible');
|
||||
cy.get('.web-form-footer .btn-primary').should('not.be.visible');
|
||||
cy.get('.btn-next').click();
|
||||
cy.get('.btn-previous').should('be.visible');
|
||||
cy.get('.btn-next').should('not.be.visible');
|
||||
cy.get('.web-form-footer .btn-primary').should('be.visible');
|
||||
cy.get('.web-form-actions .btn-primary').click();
|
||||
cy.wait(500);
|
||||
cy.get('.modal.show > .modal-dialog').should('be.visible');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -244,3 +244,10 @@ def create_topic_and_reply(web_page):
|
|||
})
|
||||
|
||||
reply.save()
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def update_webform_to_multistep():
|
||||
doc = frappe.get_doc("Web Form", "edit-profile")
|
||||
doc.is_multi_step_form = 1
|
||||
doc.save()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue