forked from frappe/frappe
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into coverage
- Loading branch information
Showing
164 changed files
with
3,956 additions
and
5,814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ concurrency: | |
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
|
||
name: Patch Test | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ concurrency: | |
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ concurrency: | |
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export default { | ||
name: 'Form With Tab Break', | ||
custom: 1, | ||
actions: [], | ||
doctype: 'DocType', | ||
engine: 'InnoDB', | ||
fields: [ | ||
{ | ||
fieldname: 'username', | ||
fieldtype: 'Data', | ||
label: 'Name', | ||
options: 'Name' | ||
}, | ||
{ | ||
fieldname: 'tab', | ||
fieldtype: 'Tab Break', | ||
label: 'Tab 2', | ||
}, | ||
{ | ||
fieldname: 'Phone', | ||
fieldtype: 'Data', | ||
label: 'Phone', | ||
options: 'Phone', | ||
reqd: 1 | ||
}, | ||
], | ||
links: [ | ||
{ | ||
"group": "Profile", | ||
"link_doctype": "Contact", | ||
"link_fieldname": "user" | ||
}, | ||
{ | ||
"group": "Profile", | ||
"link_doctype": "Chat Profile", | ||
"link_fieldname": "user" | ||
}, | ||
], | ||
modified_by: 'Administrator', | ||
module: 'Custom', | ||
owner: 'Administrator', | ||
permissions: [ | ||
{ | ||
create: 1, | ||
delete: 1, | ||
email: 1, | ||
print: 1, | ||
read: 1, | ||
role: 'System Manager', | ||
share: 1, | ||
write: 1 | ||
} | ||
], | ||
quick_entry: 1, | ||
autoname: "format: Test-{####}", | ||
sort_field: 'modified', | ||
sort_order: 'ASC', | ||
track_changes: 1 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
context("Control Float", () => { | ||
before(() => { | ||
cy.login(); | ||
cy.visit("/app/website"); | ||
}); | ||
|
||
function get_dialog_with_float() { | ||
return cy.dialog({ | ||
title: "Float Check", | ||
fields: [ | ||
{ | ||
fieldname: "float_number", | ||
fieldtype: "Float", | ||
Label: "Float" | ||
} | ||
] | ||
}); | ||
} | ||
|
||
it("check value changes", () => { | ||
get_dialog_with_float().as("dialog"); | ||
|
||
let data = get_data(); | ||
data.forEach(x => { | ||
cy.window() | ||
.its("frappe") | ||
.then(frappe => { | ||
frappe.boot.sysdefaults.number_format = x.number_format; | ||
}); | ||
x.values.forEach(d => { | ||
cy.get_field("float_number", "Float").clear(); | ||
cy.fill_field("float_number", d.input, "Float").blur(); | ||
cy.get_field("float_number", "Float").should( | ||
"have.value", | ||
d.blur_expected | ||
); | ||
|
||
cy.get_field("float_number", "Float").focus(); | ||
cy.get_field("float_number", "Float").blur(); | ||
cy.get_field("float_number", "Float").focus(); | ||
cy.get_field("float_number", "Float").should( | ||
"have.value", | ||
d.focus_expected | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
function get_data() { | ||
return [ | ||
{ | ||
number_format: "#.###,##", | ||
values: [ | ||
{ | ||
input: "364.87,334", | ||
blur_expected: "36.487,334", | ||
focus_expected: "36487.334" | ||
}, | ||
{ | ||
input: "36487,334", | ||
blur_expected: "36.487,334", | ||
focus_expected: "36487.334" | ||
}, | ||
{ | ||
input: "100", | ||
blur_expected: "100,000", | ||
focus_expected: "100" | ||
} | ||
] | ||
}, | ||
{ | ||
number_format: "#,###.##", | ||
values: [ | ||
{ | ||
input: "364,87.334", | ||
blur_expected: "36,487.334", | ||
focus_expected: "36487.334" | ||
}, | ||
{ | ||
input: "36487.334", | ||
blur_expected: "36,487.334", | ||
focus_expected: "36487.334" | ||
}, | ||
{ | ||
input: "100", | ||
blur_expected: "100.000", | ||
focus_expected: "100" | ||
} | ||
] | ||
} | ||
]; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import doctype_with_tab_break from '../fixtures/doctype_with_tab_break'; | ||
const doctype_name = doctype_with_tab_break.name; | ||
context("Form Tab Break", () => { | ||
before(() => { | ||
cy.login(); | ||
cy.visit('/app/website'); | ||
return cy.insert_doc('DocType', doctype_with_tab_break, true); | ||
}); | ||
it("Should switch tab and open correct tabs on validation error", () => { | ||
cy.new_form(doctype_name); | ||
// test tab switch | ||
cy.findByRole("tab", {name: "Tab 2"}).click(); | ||
cy.findByText("Phone"); | ||
cy.findByRole("tab", {name: "Details"}).click(); | ||
cy.findByText("Name"); | ||
|
||
// form should switch to the tab with un-filled mandatory field | ||
cy.fill_field("username", "Test"); | ||
cy.findByRole("button", {name: "Save"}).click(); | ||
cy.findByText("Missing Fields"); | ||
cy.hide_dialog(); | ||
cy.findByText("Phone"); | ||
cy.fill_field("phone", "12345678"); | ||
cy.findByRole("button", {name: "Save"}).click(); | ||
|
||
// After save, first tab should have dashboard | ||
cy.get(".form-tabs > .nav-item").eq(0).click(); | ||
cy.findByText("Connections"); | ||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.