Skip to content

Commit

Permalink
Merge pull request #368 from Fekide/367-bug-e2e-tests-fail-with-359
Browse files Browse the repository at this point in the history
367 bug e2e tests fail with 359
  • Loading branch information
sargreal authored Nov 2, 2023
2 parents 6c816f7 + 45b5d49 commit f458956
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
11 changes: 6 additions & 5 deletions playground/cypress/e2e/batch-translation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ describe('batch translation', () => {
.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.get('li[data-strapi-value=en]').click()

cy.get('div[role=option]').filter(':contains("English (en)")').click()
cy.get('div[role=dialog] button').filter(':contains("Translate")').click()

// Verify translation finished
Expand Down Expand Up @@ -65,15 +66,15 @@ describe('batch translation', () => {
.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.get('li[data-strapi-value=en]').click()
cy.get('div[role=option]').filter(':contains("English (en)")').click()
cy.get('div[role=dialog]')
.contains('label', 'Auto-Publish')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.parent()
.click()
Expand Down
20 changes: 10 additions & 10 deletions playground/cypress/e2e/direct-translation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('direct translation', () => {
cy.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.contains('German (de)').click()
Expand All @@ -29,7 +29,7 @@ describe('direct translation', () => {
cy.contains('label', 'slug')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.clear()
.type('a-bug-is-becoming-a-meme-on-the-internet-1')
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('direct translation', () => {
cy.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.contains('German (de)').click()
Expand All @@ -73,7 +73,7 @@ describe('direct translation', () => {
cy.contains('label', 'slug')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.clear()
.type('tech-1')
Expand All @@ -89,7 +89,7 @@ describe('direct translation', () => {
cy.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.contains('German (de)').click()
Expand All @@ -103,7 +103,7 @@ describe('direct translation', () => {
cy.contains('label', 'slug')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.clear()
.type('a-bug-is-becoming-a-meme-on-the-internet-1')
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('direct translation', () => {
cy.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.contains('German (de)').click()
Expand All @@ -149,13 +149,13 @@ describe('direct translation', () => {
cy.contains('label', 'metaTitle')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id.replace('.', '\\.'))
cy.get(`[id='${id.replace('.', '\\.')}']`)
})
.should('have.value', 'My personal Strapi blog')
cy.contains('label', 'shareImage')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.get('img')
.should('be.visible')
Expand Down Expand Up @@ -194,7 +194,7 @@ describe('direct translation', () => {
cy.contains('label', 'Locales')
.invoke('attr', 'for')
.then((id) => {
cy.get('#' + id)
cy.get(`[id='${id}']`)
})
.click()
cy.contains('German (de)').click()
Expand Down

0 comments on commit f458956

Please sign in to comment.