seitime-frappe/cypress/integration/awesome_bar.js
Ankush Menat 6350406305
perf: remove duplicate control assets (#17237)
* test: flaky tests due to uncleared filters

* perf: remove duplicate code in assets

Remove controls which are separately bundled too, saves ~1.1MB of
network transfer.

Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2022-06-20 14:28:38 +05:30

48 lines
1.5 KiB
JavaScript

context('Awesome Bar', () => {
before(() => {
cy.visit('/login');
cy.login();
cy.visit('/app/website');
});
beforeEach(() => {
cy.get('.navbar .navbar-home').click();
cy.findByPlaceholderText('Search or type a command (Ctrl + G)').clear();
});
it('navigates to doctype list', () => {
cy.findByPlaceholderText('Search or type a command (Ctrl + G)').type('todo', { delay: 700 });
cy.get('.awesomplete').findByRole('listbox').should('be.visible');
cy.findByPlaceholderText('Search or type a command (Ctrl + G)').type('{enter}', { delay: 700 });
cy.get('.title-text').should('contain', 'To Do');
cy.location('pathname').should('eq', '/app/todo');
});
it('find text in doctype list', () => {
cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
.type('test in todo{enter}', { delay: 700 });
cy.get('.title-text').should('contain', 'To Do');
cy.findByPlaceholderText('ID')
.should('have.value', '%test%');
cy.clear_filters();
});
it('navigates to new form', () => {
cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
.type('new blog post{enter}', { delay: 700 });
cy.get('.title-text:visible').should('have.text', 'New Blog Post');
});
it('calculates math expressions', () => {
cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
.type('55 + 32{downarrow}{enter}', { delay: 700 });
cy.get('.modal-title').should('contain', 'Result');
cy.get('.msgprint').should('contain', '55 + 32 = 87');
});
});