{"size": 3165, "ext": "js", "max_stars_repo_path": "frontend/cypress/e2e/FirstVoicesDev/_v2_words.cy.js", "max_stars_repo_name": "First-Peoples-Cultural-Council/reactjs-nuxeo-dictionary-prototype", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "frontend/cypress/e2e/FirstVoicesDev/_v2_words.cy.js", "max_issues_repo_name": "First-Peoples-Cultural-Council/reactjs-nuxeo-dictionary-prototype", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "frontend/cypress/e2e/FirstVoicesDev/_v2_words.cy.js", "max_forks_repo_name": "First-Peoples-Cultural-Council/reactjs-nuxeo-dictionary-prototype", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.1428571429, "max_line_length": 103, "alphanum_fraction": 0.5981042654}
describe('V2 tests, word and phrase', () => {
  beforeEach(() => {})

  it('Get first word and search for it', () => {
    //i moved the visit from outside of beforeEach so i don't have to get it to log in on every it test
    cy.on('uncaught:exception', (err, runnable) => {
      return false
    })

    cy.visit(Cypress.env('baseUrl') + '/' + Cypress.env('DIALECT'))

    cy.get('#MobileMenuButton').click()
    cy.wait(500)
    cy.contains('span', 'Dictionary').click()
    cy.contains('Words').click()

    cy.get('table tr td button')
      .first()
      .invoke('text')
      .then((text) => {
        cy.get('[data-testid=SearchInput').type(text + '{enter}')
      })
  })

  it('Check out word drawer', () => {
    // cy.login(info.login, info.password);
    cy.visit(Cypress.env('baseUrl') + '/' + Cypress.env('DIALECT'))

    cy.get('#MobileMenuButton').click()
    cy.wait(500)
    cy.contains('span', 'Dictionary').click()
    cy.contains('Words').click()
    cy.get('table tr td button').first().click() //drawer should be open now

    cy.get('[data-testid=DictionaryDetailPresentationDrawer]').should('be.visible')
    cy.contains('MORE')
    cy.contains('MORE').click()
    cy.contains('SHARE')
    cy.contains('SHARE').click()
    cy.contains('Cancel').click()
    cy.contains('MORE').click()
    cy.contains('QR CODE')
    cy.contains('QR CODE').click()
    cy.contains('Cancel').click()

    //  cy.get('#WordMedia').should('be.visible')

    cy.contains('Part of Speech')
    cy.contains('Pronunciation')
  })

  it('Check out Phrases drawer', () => {
    //cy.login(info.login, info.password);
    cy.visit(Cypress.env('baseUrl') + '/' + Cypress.env('DIALECT'))

    cy.get('#MobileMenuButton').click()
    cy.wait(500)
    cy.contains('span', 'Dictionary').click()
    cy.contains('Phrases').click()
    cy.get('table tr td button').first().click() //drawer should be open now

    cy.get('[data-testid=DictionaryDetailPresentationDrawer]').should('be.visible')
    cy.contains('MORE')
    cy.contains('MORE').click()
    cy.contains('SHARE')
    cy.contains('SHARE').click()
    cy.contains('Cancel').click()
    cy.contains('MORE').click()
    cy.contains('QR CODE')
    cy.contains('QR CODE').click()
    cy.contains('Cancel').click()

    // cy.get('#WordMedia').should('be.visible')
  })

  it('Check out word sub menu', () => {
    //  cy.login(info.login, info.password);
    cy.visit(Cypress.env('baseUrl') + '/' + Cypress.env('DIALECT'))

    cy.get('#MobileMenuButton').click()
    cy.wait(500)
    cy.contains('span', 'Dictionary').click()
    cy.contains('Words').click()

    cy.wait(500)

    // cy.contains('End of').scrollIntoView().should('be.visible')

    cy.scrollTo('bottom', { duration: 1000 })
    cy.get('table tr')
    cy.get('#DictionaryListPresentation div').last().contains('End of')
    // for (let i = 0; i < 15; i++) {
    //   cy.scrollTo('bottom', { duration: 1000 })
    //   cy.wait(500)
    // }

    // cy.contains('End of results')

    //cy.get("[id^='headlessui-menu-button']").last().click()

    //cy.contains('SHARE').should('be.visible')
    //cy.contains('QR CODE').should('be.visible')
  })
})
