您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

48 行
1.5 KiB

  1. context('Awesome Bar', () => {
  2. before(() => {
  3. cy.visit('/login');
  4. cy.login();
  5. cy.visit('/app/website');
  6. });
  7. beforeEach(() => {
  8. cy.get('.navbar .navbar-home').click();
  9. cy.findByPlaceholderText('Search or type a command (Ctrl + G)').clear();
  10. });
  11. it('navigates to doctype list', () => {
  12. cy.findByPlaceholderText('Search or type a command (Ctrl + G)').type('todo', { delay: 700 });
  13. cy.get('.awesomplete').findByRole('listbox').should('be.visible');
  14. cy.findByPlaceholderText('Search or type a command (Ctrl + G)').type('{downarrow}{enter}', { delay: 700 });
  15. cy.get('.title-text').should('contain', 'To Do');
  16. cy.location('pathname').should('eq', '/app/todo');
  17. });
  18. it('find text in doctype list', () => {
  19. cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
  20. .type('test in todo{downarrow}{enter}', { delay: 700 });
  21. cy.get('.title-text').should('contain', 'To Do');
  22. cy.findByPlaceholderText('Name')
  23. .should('have.value', '%test%');
  24. });
  25. it('navigates to new form', () => {
  26. cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
  27. .type('new blog post{downarrow}{enter}', { delay: 700 });
  28. cy.get('.title-text:visible').should('have.text', 'New Blog Post');
  29. });
  30. it('calculates math expressions', () => {
  31. cy.findByPlaceholderText('Search or type a command (Ctrl + G)')
  32. .type('55 + 32{downarrow}{enter}', { delay: 700 });
  33. cy.get('.modal-title').should('contain', 'Result');
  34. cy.get('.msgprint').should('contain', '55 + 32 = 87');
  35. });
  36. });