Skip to content

Commit

Permalink
fixup! feat(Templates): extend the tutorial table
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzz committed Jan 15, 2025
1 parent af9f18e commit e6b68bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/tables-export-csv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Import csv', () => {

it('Export csv', () => {
console.log('before table load')
cy.loadTutorialTable()
cy.loadTable('Welcome to Nextcloud Tables!')()
console.log('before click')
cy.clickOnTableThreeDotMenu('Export as CSV')
const hour = new Date().getHours().toString().length < 2 ? '0' + new Date().getHours() : new Date().getHours().toString()
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/tables-favorite.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Favorite tables/views', () => {
it('can favorite tables', () => {
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')

cy.get('@tutorialTable').should('contain.text', 'Welcome to ')
cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true })

cy.intercept({ method: 'POST', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*'}).as('favoriteTableReq')
Expand All @@ -34,7 +34,7 @@ describe('Favorite tables/views', () => {
it('can remove favorite table', () => {
cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable')

cy.get('@tutorialTable').should('contain.text', 'Welcome to ')
cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true })

cy.intercept({ method: 'DELETE', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*' }).as('unfavoriteTableReq')
Expand All @@ -45,7 +45,7 @@ describe('Favorite tables/views', () => {
})

it('can favorite views', () => {
cy.loadTutorialTable
cy.loadTable('Welcome to Nextcloud Tables!')

cy.get('[data-cy="navigationViewItem"]').first().as('testView')

Expand Down Expand Up @@ -82,7 +82,7 @@ describe('Favorite tables/views', () => {

cy.get('@testView').parent().should('contain.text', 'Favorites')

cy.get('@tutorialTable').should('contain.text', 'Welcome to ')
cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!')
cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true })
cy.contains('Add to favorites').click({ force: true })

Expand Down
5 changes: 0 additions & 5 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ Cypress.Commands.add('loadTable', (name) => {
cy.get('[data-cy="navigationTableItem"] a[title="' + name + '"]').click({ force: true })
})

// The name depends on the instance name, Nextcloud might be overwritten
Cypress.Commands.add('loadTutorialTable', () => {
cy.get('[data-cy="navigationTableItem"] a[title^="Welcome to"]').click({ force: true })
})

Cypress.Commands.add('getTutorialTableName', () => {
return cy.get('[data-cy="navigationTableItem"] a[title^="Welcome to"]').invoke('attr', 'title').then((title) => {
return cy.wrap(title)
Expand Down

0 comments on commit e6b68bb

Please sign in to comment.