Skip to content

Commit

Permalink
Update parsing for new click-in-text API
Browse files Browse the repository at this point in the history
  • Loading branch information
Madoshakalaka committed Nov 18, 2020
1 parent ad5f6cf commit d06eadd
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 88 deletions.
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"video": false}
{"video": false, "defaultCommandTimeout": 10000 }
2 changes: 1 addition & 1 deletion cypress/integration/copy_translation_to_clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Clipboard', function() {

cy.get('#test1').click()

cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')

// cy.get('.blank-rectangle').move()

Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/oops_option.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
describe('Always show oops setting', function() {
it('shows oops message', function() {
cy.visit('localhost:8080/test.html')
cy.get('#non_cree_hello').click()
cy.get('#Chinese').click()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'Oops..')
})
})
Expand All @@ -13,7 +13,7 @@ describe('Never show oops setting', function() {
cy.set_option(()=>{
cy.get('#do_not_show_oops').check()
})
cy.get('#non_cree_hello').click()
cy.get('#Chinese').click()
cy.get('transover-popup').should('not.exist')
})
})
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/translate_by_clicking.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
describe('Default settings', function() {
it('shows popup for niskak', function() {
it('shows popup for cree', function() {
cy.visit('localhost:8080/test.html')
// cy.get('#test1').move()

// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500) // for javascript to settle
cy.get('#test1').click()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')

})
})
Expand All @@ -27,13 +27,13 @@ describe('alt trigger-key', function() {

cy.get('body').type('{alt}', { release: false })
.get('#test1').click()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')

})
})

describe('ctrl trigger-key', function() {
it('shows popup for niskak only when control is held', function() {
it('shows popup for cree only when control is held', function() {
cy.visit('localhost:8080/test.html')

cy.set_option(()=>{
Expand All @@ -45,7 +45,7 @@ describe('ctrl trigger-key', function() {

cy.get('body').type('{ctrl}', { release: false })
.get('#test1').click()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
cy.get('body').type('{ctrl}') // release the key

})
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/translate_by_hovering.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

describe('Default settings', function() {
it('shows popup for niskak', function() {
it('shows popup for cree', function() {
cy.visit('localhost:8080/test.html')

cy.set_option(()=>{
cy.get('#translate_by').select('point at word')
})
cy.get('#test1').move()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
})
})

describe('alt trigger-key', function() {
it('shows popup for niskak only when alt is held', function() {
it('shows popup for cree only when alt is held', function() {
cy.visit('localhost:8080/test.html')

cy.set_option(()=>{
Expand All @@ -24,14 +24,14 @@ describe('alt trigger-key', function() {

cy.get('body').type('{alt}', { release: false })
.get('#test1').move()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
cy.get('body').type('{alt}') // release the key

})
})

describe('ctrl trigger-key', function() {
it('shows popup for niskak only when control is held', function() {
it('shows popup for cree only when control is held', function() {
cy.visit('localhost:8080/test.html')

cy.set_option(()=>{
Expand All @@ -44,7 +44,7 @@ describe('ctrl trigger-key', function() {

cy.get('body').type('{ctrl}', { release: false })
.get('#test1').move()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
cy.get('body').type('{ctrl}') // release the key

})
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/translation_by_selection.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
describe('Default settings', function() {
it('displays a popup for niskak', function() {
it('displays a popup for cree', function() {

cy.visit('localhost:8080/test.html')

cy.get('#test1').selectText()

cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
})
})


describe('alt trigger-key', function() {
it('shows popup for niskak only when alt is held', function() {
it('shows popup for cree only when alt is held', function() {
cy.visit('localhost:8080/test.html')

cy.set_option(()=>{
Expand All @@ -20,14 +20,14 @@ describe('alt trigger-key', function() {

cy.get('body').type('{alt}', { release: false })
.get('#test1').selectText()
cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
cy.get('body').type('{alt}') // release the key

})
})

// describe('ctrl trigger-key', function() {
// it('shows popup for niskak only when control is held', function() {
// it('shows popup for cree only when control is held', function() {
// cy.visit('localhost:8080/test.html')
//
// cy.set_option(()=>{
Expand All @@ -40,7 +40,7 @@ describe('alt trigger-key', function() {
//
// cy.get('body').type('{ctrl}', { release: false })
// .get('#test1').move()
// cy.get('transover-popup').should('have.attr', 'content').and('include', 'damp')
// cy.get('transover-popup').should('have.attr', 'content').and('include', 'see')
// cy.get('body').type('{ctrl}') // release the key
//
// })
Expand Down
Loading

0 comments on commit d06eadd

Please sign in to comment.