瀏覽代碼

test: fixed failing UI test

version-14
Shariq Ansari 3 年之前
父節點
當前提交
3a2cd2650e
共有 3 個檔案被更改,包括 11 行新增4 行删除
  1. +9
    -3
      cypress/integration/workspace_blocks.js
  2. +1
    -0
      cypress/support/commands.js
  3. +1
    -1
      frappe/commands/utils.py

+ 9
- 3
cypress/integration/workspace_blocks.js 查看文件

@@ -71,6 +71,11 @@ context('Workspace Blocks', () => {
} }
]); ]);


cy.intercept({
method: 'GET',
url: 'api/method/frappe.desk.form.load.getdoctype'
}).as('get_doctype');

cy.get('.codex-editor__redactor .ce-block'); cy.get('.codex-editor__redactor .ce-block');
cy.get('.standard-actions .btn-secondary[data-label=Edit]').click(); cy.get('.standard-actions .btn-secondary[data-label=Edit]').click();


@@ -82,6 +87,7 @@ context('Workspace Blocks', () => {


cy.fill_field('document_type', 'ToDo', 'Link').blur(); cy.fill_field('document_type', 'ToDo', 'Link').blur();
cy.fill_field('label', 'ToDo', 'Data').blur(); cy.fill_field('label', 'ToDo', 'Data').blur();
cy.wait('@get_doctype');


cy.get_open_dialog().find('.filter-edit-area').should('contain', 'No filters selected'); cy.get_open_dialog().find('.filter-edit-area').should('contain', 'No filters selected');
cy.get_open_dialog().find('.filter-area .add-filter').click(); cy.get_open_dialog().find('.filter-area .add-filter').click();
@@ -102,7 +108,7 @@ context('Workspace Blocks', () => {
cy.get('@todo-quick-list').find('.quick-list-item .status').should('contain', 'Open'); cy.get('@todo-quick-list').find('.quick-list-item .status').should('contain', 'Open');


// test filter-list // test filter-list
cy.get('@todo-quick-list').find('.widget-control .filter-list').click();
cy.get('@todo-quick-list').realHover().find('.widget-control .filter-list').click();


cy.get_open_dialog().find('select.input-with-feedback').select('Closed'); cy.get_open_dialog().find('select.input-with-feedback').select('Closed');
cy.get_open_dialog().find('.modal-header').click(); cy.get_open_dialog().find('.modal-header').click();
@@ -117,12 +123,12 @@ context('Workspace Blocks', () => {
url: 'api/method/frappe.desk.reportview.get' url: 'api/method/frappe.desk.reportview.get'
}).as('refresh-list'); }).as('refresh-list');


cy.get('@todo-quick-list').find('.widget-control .refresh-list').click();
cy.get('@todo-quick-list').realHover().find('.widget-control .refresh-list').click();
cy.wait('@refresh-list'); cy.wait('@refresh-list');




// test add-new // test add-new
cy.get('@todo-quick-list').find('.widget-control .add-new').click();
cy.get('@todo-quick-list').realHover().find('.widget-control .add-new').click();
cy.url().should('include', `/todo/new-todo-1`); cy.url().should('include', `/todo/new-todo-1`);
cy.go('back'); cy.go('back');




+ 1
- 0
cypress/support/commands.js 查看文件

@@ -1,6 +1,7 @@
import 'cypress-file-upload'; import 'cypress-file-upload';
import '@testing-library/cypress/add-commands'; import '@testing-library/cypress/add-commands';
import '@4tw/cypress-drag-drop'; import '@4tw/cypress-drag-drop';
import "cypress-real-events/support";
// *********************************************** // ***********************************************
// This example commands.js shows you how to // This example commands.js shows you how to
// create various custom commands and overwrite // create various custom commands and overwrite


+ 1
- 1
frappe/commands/utils.py 查看文件

@@ -870,7 +870,7 @@ def run_ui_tests(
# install cypress # install cypress
click.secho("Installing Cypress...", fg="yellow") click.secho("Installing Cypress...", fg="yellow")
frappe.commands.popen( frappe.commands.popen(
"yarn add cypress@^6 cypress-file-upload@^5 @4tw/cypress-drag-drop@^2 @testing-library/cypress@^8 @cypress/code-coverage@^3 --no-lockfile"
"yarn add cypress@^6 cypress-file-upload@^5 @4tw/cypress-drag-drop@^2 cypress-real-events @testing-library/cypress@^8 @cypress/code-coverage@^3 --no-lockfile"
) )


# run for headless mode # run for headless mode


Loading…
取消
儲存