Skip to content

Commit

Permalink
Add create wiki page test
Browse files Browse the repository at this point in the history
  • Loading branch information
Walmyr Filho committed Mar 6, 2020
1 parent 8e6799e commit 3140bd6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cypress/integration/gui/createWiki.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const faker = require('faker')

describe('Create new page', () => {
const project = { name: faker.random.uuid() }

beforeEach(() => {
cy.gui_login()
cy.api_createProject(project)
cy.visit(`${Cypress.env('user_name')}/${project.name}/wikis/home?view=create`)
})

after(() => cy.api_deleteProjects())

it('successfully', () => {
const wikiContent = faker.random.words(4)

cy.get('.qa-wiki-content-textarea').type(wikiContent)
cy.contains('Create page').click()

cy.url().should('be.equal', `${Cypress.config('baseUrl')}${Cypress.env('user_name')}/${project.name}/wikis/home`)
cy.get('[data-qa-selector="wiki_page_content"]').should('contain', wikiContent)
})
})

0 comments on commit 3140bd6

Please sign in to comment.