test: Add clear cache command

This commit is contained in:
Suraj Shetty 2019-06-03 09:33:51 +05:30
parent 4b120aabea
commit 8d40f513eb
2 changed files with 7 additions and 1 deletions

View file

@ -4,8 +4,8 @@ context('List View', () => {
cy.visit('/desk');
cy.window().its('frappe').then(frappe => {
frappe.call("frappe.tests.test_utils.setup_workflow");
cy.reload();
});
cy.clear_cache();
});
it('enables "Actions" button', () => {
const actions = ['Approve', 'Reject', 'Edit', 'Assign To', 'Print','Delete'];

View file

@ -66,6 +66,12 @@ Cypress.Commands.add('go_to_list', (doctype) => {
cy.visit(`/desk#List/${doctype}/List`);
});
Cypress.Commands.add('clear_cache', () => {
cy.window().its('frappe').then(frappe => {
frappe.ui.toolbar.clear_cache();
});
});
Cypress.Commands.add('dialog', (title, fields) => {
cy.window().then(win => {
var d = new win.frappe.ui.Dialog({