Selaa lähdekoodia

test: UI test for datetime field form validation

version-14
shariquerik 3 vuotta sitten
vanhempi
commit
75cb917a7b
2 muutettua tiedostoa jossa 30 lisäystä ja 0 poistoa
  1. +18
    -0
      cypress/integration/datetime_field_form_validation.js
  2. +12
    -0
      frappe/tests/ui_test_helpers.py

+ 18
- 0
cypress/integration/datetime_field_form_validation.js Näytä tiedosto

@@ -0,0 +1,18 @@
context('Datetime Validation', () => {
before(() => {
cy.login();
cy.visit('/app/communication');
cy.window().its('frappe').then(frappe => {
frappe.call("frappe.tests.ui_test_helpers.create_communication_records");
});
});

it('datetime field form validation', () => {
cy.visit('/app/communication');
cy.get('a[title="Test Form Communication 1"]').invoke('attr', 'data-name')
.then((name) => {
cy.visit(`/app/communication/${name}`);
cy.get('.indicator-pill').should('contain', 'Open').should('have.class', 'red');
})
});
});

+ 12
- 0
frappe/tests/ui_test_helpers.py Näytä tiedosto

@@ -60,6 +60,18 @@ def create_todo_records():
"description": "this is fourth todo"
}).insert()

@frappe.whitelist()
def create_communication_records():
if frappe.db.get_all('Communication', {'subject': 'Test Form Communication 1'}):
return

frappe.get_doc({
"doctype": "Communication",
"recipients": "test@gmail.com",
"subject": "Test Form Communication 1",
"communication_date": frappe.utils.now_datetime(),
}).insert()

@frappe.whitelist()
def setup_workflow():
from frappe.workflow.doctype.workflow.test_workflow import create_todo_workflow


Ladataan…
Peruuta
Tallenna