ソースを参照

fix: ui tests

version-14
prssanna 5年前
コミット
30d20610c4
2個のファイルの変更7行の追加3行の削除
  1. +6
    -1
      cypress/integration/grid_pagination.js
  2. +1
    -2
      frappe/tests/ui_test_helpers.py

+ 6
- 1
cypress/integration/grid_pagination.js ファイルの表示

@@ -1,6 +1,7 @@
context('Grid Pagination', () => {
beforeEach(() => {
cy.visit('/desk#Form/Contact/Test Contact');
cy.login();
cy.visit('/desk');
});
before(() => {
cy.login();
@@ -10,12 +11,14 @@ context('Grid Pagination', () => {
});
});
it('creates pages for child table', () => {
cy.visit('/desk#Form/Contact/Test Contact');
cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table');
cy.get('@table').find('.current-page-number').should('contain', '1');
cy.get('@table').find('.total-page-number').should('contain', '50');
cy.get('@table').find('.grid-body .grid-row').should('have.length', 20);
});
it('goes to the next and previous page', () => {
cy.visit('/desk#Form/Contact/Test Contact');
cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table');
cy.get('@table').find('.next-page').click();
cy.get('@table').find('.current-page-number').should('contain', '2');
@@ -25,6 +28,7 @@ context('Grid Pagination', () => {
cy.get('@table').find('.grid-body .grid-row').first().should('have.attr', 'data-idx', '1');
});
it('adds and deletes rows and changes page', ()=> {
cy.visit('/desk#Form/Contact/Test Contact');
cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table');
cy.get('@table').find('button.grid-add-row').click();
cy.get('@table').find('.grid-body .row-index').should('contain', 1001);
@@ -37,6 +41,7 @@ context('Grid Pagination', () => {
cy.get('@table').find('.total-page-number').should('contain', '50');
});
it('deletes all rows', ()=> {
cy.visit('/desk#Form/Contact/Test Contact');
cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table');
cy.get('@table').find('.grid-heading-row .grid-row-check').click({force: true});
cy.get('@table').find('button.grid-remove-all-rows').click();


+ 1
- 2
frappe/tests/ui_test_helpers.py ファイルの表示

@@ -71,7 +71,6 @@ def create_contact_phone_nos_records():

doc = frappe.new_doc('Contact')
doc.first_name = 'Test Contact'
doc.insert()
for x in range(1000):
doc.append('phone_nos', {'phone': '123456789'})
doc.save()
doc.insert()

読み込み中…
キャンセル
保存