operation_create_html-document.js 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. describe('operation :: workspace > create_new > html-document', function () {
  2. before(function () {
  3. //login
  4. cy.visit('/login')
  5. cy.get('input[type=email]').type('admin@admin.admin')
  6. cy.get('input[type=password]').type('admin@admin.admin')
  7. cy.get('form').find('button').get('.connection__form__btnsubmit').click()
  8. })
  9. it ('dashborad > button', function(){
  10. var titre1='dashbord button'
  11. cy.url().should('include', '/workspaces/1/dashboard')
  12. cy.get('.dashboard__calltoaction div:nth-child(4) .dashboard__calltoaction__button__text').should('be.visible')
  13. cy.get('.dashboard__calltoaction div:nth-child(4) .dashboard__calltoaction__button__text').click()
  14. cy.get('.createcontent .createcontent__contentname').should('be.visible')
  15. cy.get('.createcontent .createcontent__form__input').should('have.attr', 'placeholder')
  16. cy.get('.createcontent .createcontent__form__input').type(titre1)
  17. cy.get('.createcontent .createcontent__form__input').should('have.attr', 'value', titre1)
  18. cy.get('.createcontent button.createcontent__form__button').click()
  19. cy.get('.createcontent .createcontent__contentname').should('not.be.visible')
  20. cy.get('.html-document.visible').should('be.visible')
  21. cy.get('#appFeatureContainer .wsContentGeneric__header__title').contains(titre1)
  22. // Problem to write text in iframe
  23. // cy.get('#wysiwygNewVersion_ifr').click()
  24. // cy.get('body').type('Ceci est le début du document')
  25. // cy.get('.html-document__editionmode__submit.editionmode__button__submit').click()
  26. // cy.get('.html-document__contentpage__textnote__text span').contains('Ceci est le début du document')
  27. cy.get('.html-document__header__close').should('be.visible')
  28. cy.get('.html-document__header__close').click()
  29. cy.get('.html-document.visible').should('not.be.visible')
  30. // Need improvement to verified new content is in list
  31. // cy.get('.workspace__content__fileandfolder .content__name__text').find(titre1)
  32. })
  33. it ('all content > header button ', function () {
  34. var titre2='all content button'
  35. cy.url().should('include', '/workspaces/1/contents')
  36. cy.get('.workspace__header__btnaddcontent__label').should('be.visible')
  37. cy.get('.workspace__header__btnaddcontent__label').click()
  38. cy.get('.workspace__header__btnaddcontent__setting div:nth-child(4).subdropdown__link').click()
  39. cy.get('.createcontent .createcontent__contentname').should('be.visible')
  40. cy.get('.createcontent .createcontent__form__input').should('have.attr', 'placeholder')
  41. cy.get('.createcontent .createcontent__form__input').type(titre2)
  42. cy.get('.createcontent .createcontent__form__input').should('have.attr', 'value', titre2)
  43. cy.get('.createcontent button.createcontent__form__button').click()
  44. cy.get('.createcontent .createcontent__contentname').should('not.be.visible')
  45. cy.get('.html-document.visible').should('be.visible')
  46. cy.get('.html-document.visible .wsContentGeneric__header__title').should('be.visible')
  47. cy.get('.html-document.visible .wsContentGeneric__header__title').contains(titre2)
  48. cy.get('.html-document.visible .html-document__header__close').should('be.visible')
  49. cy.get('.html-document.visible .html-document__header__close').click()
  50. cy.get('.html-document.visible').should('not.be.visible')
  51. // Need improvement to verified new content is in list
  52. // cy.get('.workspace__content__fileandfolder .content__name__text').find(titre1)
  53. })
  54. })