chore(e2e): remove test running 100 times (#12777)

* chore(e2e): remove test running 100 times

* fix: add orgID to createLabel
pull/12785/head
Andrew Watkins 2019-03-20 10:38:17 -07:00 committed by GitHub
parent 49d025ba64
commit 47882c8818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 26 deletions

View File

@ -56,21 +56,19 @@ describe('Dashboards', () => {
cy.visit('/dashboards')
})
for (let i = 0; i < 100; i++) {
it.only('can delete a dashboard', () => {
cy.getByTestID('dashboard-card').should('have.length', 2)
it('can delete a dashboard', () => {
cy.getByTestID('dashboard-card').should('have.length', 2)
cy.getByTestID('dashboard-card')
.first()
.trigger('mouseover')
.within(() => {
cy.getByTestID('context-delete-menu').click()
cy.getByTestID('context-delete-dashboard').click()
})
cy.getByTestID('dashboard-card')
.first()
.trigger('mouseover')
.within(() => {
cy.getByTestID('context-delete-menu').click()
cy.getByTestID('context-delete-dashboard').click()
})
cy.getByTestID('dashboard-card').should('have.length', 1)
})
}
cy.getByTestID('dashboard-card').should('have.length', 1)
})
it('can edit a dashboards name', () => {
const newName = 'new 🅱ashboard'
@ -123,20 +121,22 @@ describe('Dashboards', () => {
it('can add an existing label to a dashboard', () => {
const labelName = 'swogglez'
cy.createLabel(labelName).then(() => {
cy.getByTestID(`inline-labels--add`)
.first()
.click()
cy.get<Organization>('@org').then(({id}) => {
cy.createLabel(labelName, id).then(() => {
cy.getByTestID(`inline-labels--add`)
.first()
.click()
cy.getByTestID('inline-labels--popover').within(() => {
cy.getByTestID(`label--pill ${labelName}`).click()
})
cy.getByTestID('dashboard-card')
.first()
.within(() => {
cy.getByTestID(`label--pill ${labelName}`).should('be.visible')
cy.getByTestID('inline-labels--popover').within(() => {
cy.getByTestID(`label--pill ${labelName}`).click()
})
cy.getByTestID('dashboard-card')
.first()
.within(() => {
cy.getByTestID(`label--pill ${labelName}`).should('be.visible')
})
})
})
})

View File

@ -100,13 +100,15 @@ export const createVariable = (
}
export const createLabel = (
name?: string
name?: string,
orgID?: string
): Cypress.Chainable<Cypress.Response> => {
return cy.request({
method: 'POST',
url: '/api/v2/labels',
body: {
name,
orgID,
properties: {
description: `test ${name}`,
color: '#ff0054',