diff --git a/cypress/e2e/dashboard/phrases.cy.js b/cypress/e2e/dashboard/phrases.cy.js index 57f88701..9eabdf37 100644 --- a/cypress/e2e/dashboard/phrases.cy.js +++ b/cypress/e2e/dashboard/phrases.cy.js @@ -61,7 +61,7 @@ describe( cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() cy.contains('Dashboard').click() - cy.get('[data-testid="DashboardPresentationEdit"]').click() + cy.get('[data-testid="dashboard-edit-link"]').click() cy.contains('Edit phrases').click() cy.contains('Loading').should('be.visible') cy.contains('Loading').should('not.exist') diff --git a/cypress/e2e/dashboard/reports.cy.js b/cypress/e2e/dashboard/reports.cy.js index 3e1c6397..b61bb54b 100644 --- a/cypress/e2e/dashboard/reports.cy.js +++ b/cypress/e2e/dashboard/reports.cy.js @@ -75,7 +75,7 @@ describe( cy.contains('Explore Languages').click() cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() cy.contains('Dashboard').click() - cy.get('[data-testid="DashboardPresentationReports"]').click() + cy.get('[data-testid="dashboard-reports-link"]').click() }) it('check page loaded', () => { diff --git a/cypress/e2e/dashboard/speaker.cy.js b/cypress/e2e/dashboard/speaker.cy.js index cb030323..27035112 100644 --- a/cypress/e2e/dashboard/speaker.cy.js +++ b/cypress/e2e/dashboard/speaker.cy.js @@ -30,45 +30,48 @@ describe( }) cy.contains('Explore Languages').click() }) + + const testSpeakerName = Date.now().toString() it('Create Speaker', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() - cy.contains('Dashboard').click() - cy.contains('Create').click() - cy.contains('Add a speaker').click() + cy.get('[data-testid="user-menu-btn"]').click() + cy.get('[data-testid="user-dashboard-link"]').click() + cy.get('[data-testid="dashboard-create-link"]').click() + cy.get('[data-testid="create-speaker-link"]').click() - cy.contains('Add Speaker').click() + cy.get('[data-testid="form-submit"]').click() cy.contains('name must be at least 1 characters').should('be.visible') cy.contains('A bio is required').should('be.visible') - cy.get('#name').type('qatestspeaker') + cy.get('#name').type(testSpeakerName) cy.get('#bio').type('qabio test - new speaker') - cy.contains('Add Speaker').click() - cy.contains('Dismiss').should('be.visible') + cy.get('[data-testid="form-submit"]').click() + cy.get('[data-testid="success-close-btn"]').should('exist') }) it('Edit Speaker', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() - cy.contains('Dashboard').click() - cy.contains('Edit').click() - cy.contains('Edit speakers').click() - cy.get('[data-testid="edit-speaker-qatestspeaker"]').click() + cy.get('[data-testid="user-menu-btn"]').click() + cy.get('[data-testid="user-dashboard-link"]').click() + cy.get('[data-testid="dashboard-edit-link"]').click() + cy.get('[data-testid="edit-speakers-link"]').click() + cy.get(`[data-testid="edit-speaker-${testSpeakerName}"]`).click() cy.get('#bio').type('this is the new value') - cy.contains('Save Changes').click() + cy.get('[data-testid="form-submit"]').click() + cy.get('[data-testid="success-close-btn"]').should('exist') }) it('Delete Speaker', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains(`${Cypress.env('CYPRESS_FV_INITIALS')}`).click() - cy.contains('Dashboard').click() - cy.contains('Edit').click() - cy.contains('Edit speakers').click() - cy.get('[data-testid="edit-speaker-qatestspeaker"]').click() + cy.get('[data-testid="user-menu-btn"]').click() + cy.get('[data-testid="user-dashboard-link"]').click() + cy.get('[data-testid="dashboard-edit-link"]').click() + cy.get('[data-testid="edit-speakers-link"]').click() + cy.get(`[data-testid="edit-speaker-${testSpeakerName}"]`).click() cy.get('#bio') .invoke('val') .then((sometext) => sometext === 'this is the new value') - cy.contains('Delete Speaker').click() + cy.get('[data-testid="delete-btn"]').click() cy.get('[data-testid="DeleteModal"]').contains('Delete').click() }) }, diff --git a/cypress/e2e/songs.cy.js b/cypress/e2e/songs.cy.js index b03ec672..7b691266 100644 --- a/cypress/e2e/songs.cy.js +++ b/cypress/e2e/songs.cy.js @@ -13,30 +13,46 @@ describe( it('10.3 - Click on songs grid view', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains('Learn').click() - cy.contains('Songs').click() - cy.get('ul li').each((_song) => { - cy.wrap(_song).click() - cy.contains('Loading').should('not.exist') - - cy.contains('Go to Song', { timeout: 12000 }) - cy.get('#CloseDrawerBtn').click() - }) + cy.contains('p', 'Learn').should('be.visible') + cy.get('[data-testid="navigation-learn-btn"]').click() + cy.get('[data-testid="navigation-songs-link"]').click() + cy.location('pathname').should( + 'match', + `/${Cypress.env('DIALECT')}/songs`, + ) + cy.get('[data-testid="song-story-grid-tile"]', { timeout: 10000 }).each( + (_song) => { + cy.wrap(_song).scrollIntoView() + cy.wrap(_song).click() + cy.contains('Loading').should('not.exist') + cy.get('[data-testid="song-link"]').scrollIntoView() + cy.get('[data-testid="song-link"]').should('be.visible') + cy.get('#CloseDrawerBtn').click() + cy.get('[data-testid="song-link"]').should('not.exist') + }, + ) }) it('10.4 - Check list view songs', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains('Learn').click() - cy.contains('Songs').click() - cy.contains('Use list view').click() - cy.get('.pb-16 > .w-full >').each((_song) => { - cy.wrap(_song).scrollIntoView() - cy.wrap(_song).should('be.enabled') - cy.wrap(_song).click() - cy.contains('Go to Song').scrollIntoView() - cy.contains('Go to Song') - cy.get('#CloseDrawerBtn').click() - }) + cy.contains('p', 'Learn').should('be.visible') + cy.get('[data-testid="navigation-learn-btn"]').click() + cy.get('[data-testid="navigation-songs-link"]').click() + cy.location('pathname').should( + 'match', + `/${Cypress.env('DIALECT')}/songs`, + ) + cy.get('[data-testid="grid-off-btn"]').click() + cy.get('[data-testid="song-story-list-row"]', { timeout: 10000 }).each( + (_song) => { + cy.wrap(_song).scrollIntoView() + cy.wrap(_song).should('be.enabled') + cy.wrap(_song).click() + cy.get('[data-testid="song-link"]').scrollIntoView() + cy.get('[data-testid="song-link"]').should('be.visible') + cy.get('#CloseDrawerBtn').click() + }, + ) }) }, ) // end of describe diff --git a/cypress/e2e/stories.cy.js b/cypress/e2e/stories.cy.js index 587c2432..c662981a 100644 --- a/cypress/e2e/stories.cy.js +++ b/cypress/e2e/stories.cy.js @@ -14,29 +14,41 @@ describe( it('10.1 - Click on stories grid view', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains('Learn').click() - cy.contains('Stories').click() - cy.get('ul li', { timeout: 10000 }).each((_song) => { - cy.wrap(_song).click() - cy.contains('Go to Story', { timeout: 12000 }) - cy.get('#CloseDrawerBtn').click() - cy.contains('Go to Story').should('not.exist') - }) + cy.contains('p', 'Learn').should('be.visible') + cy.get('[data-testid="navigation-learn-btn"]').click() + cy.get('[data-testid="navigation-stories-link"]').click() + cy.location('pathname').should('eq', `/${Cypress.env('DIALECT')}/stories`) + cy.get('[data-testid="song-story-grid-tile"]', { timeout: 10000 }).each( + (_story) => { + cy.wrap(_story).scrollIntoView() + cy.wrap(_story).click() + + cy.get('[data-testid="story-link"]').scrollIntoView() + cy.get('[data-testid="story-link"]').should('be.visible') + cy.get('#CloseDrawerBtn').click() + cy.get('[data-testid="story-link"]').should('not.exist') + }, + ) }) it('10.2 - Check list view stories', () => { cy.visit(`${Cypress.env('baseUrl')}${Cypress.env('DIALECT')}`) - cy.contains('Learn').click() - cy.contains('Stories').click() - cy.contains('Use list view').click() - cy.get('.pb-16 > .w-full >', { timeout: 10000 }).each((_song) => { - cy.wrap(_song).should('be.enabled') - cy.wrap(_song).click() - cy.contains('Loading').should('not.exist') - cy.contains('Go to Story').scrollIntoView() - cy.contains('Go to Story').should('be.visible') - cy.get('#CloseDrawerBtn').click() - }) + cy.contains('p', 'Learn').should('be.visible') + cy.get('[data-testid="navigation-learn-btn"]').click() + cy.get('[data-testid="navigation-stories-link"]').click() + cy.location('pathname').should('eq', `/${Cypress.env('DIALECT')}/stories`) + cy.get('[data-testid="grid-off-btn"]').click() + cy.get('[data-testid="song-story-list-row"]', { timeout: 10000 }).each( + (_story) => { + cy.wrap(_story).scrollIntoView() + cy.wrap(_story).should('be.enabled') + cy.wrap(_story).click() + + cy.get('[data-testid="story-link"]').scrollIntoView() + cy.get('[data-testid="story-link"]').should('be.visible') + cy.get('#CloseDrawerBtn').click() + }, + ) }) }, ) // end of describe diff --git a/src/components/Dashboard/DashboardPresentation.js b/src/components/Dashboard/DashboardPresentation.js index 6d43bb96..4482a2ec 100644 --- a/src/components/Dashboard/DashboardPresentation.js +++ b/src/components/Dashboard/DashboardPresentation.js @@ -66,30 +66,35 @@ function DashboardPresentation({ children, currentUser, site, logout }) { const primaryNavigationItems = (currentSitename) => { const navigation = [ { + testid: 'dashboard-home-link', name: 'Dashboard', href: `/${currentSitename}/dashboard`, icon: 'Dashboard', auth: MEMBER, }, { + testid: 'dashboard-create-link', name: 'Create', href: `/${currentSitename}/dashboard/create`, icon: 'Create', auth: ASSISTANT, }, { + testid: 'dashboard-edit-link', name: 'Edit', href: `/${currentSitename}/dashboard/edit`, icon: 'Pencil', auth: ASSISTANT, }, { + testid: 'dashboard-media-link', name: 'Media', href: `/${currentSitename}/dashboard/media`, icon: 'Microphone', auth: ASSISTANT, }, { + testid: 'dashboard-reports-link', name: 'Reports', href: `/${currentSitename}/dashboard/reports`, icon: 'Reports', @@ -104,7 +109,7 @@ const primaryNavigationItems = (currentSitename) => { return ( { if (sites?.length > 0) { sites.forEach((site) => secondaryNavigation.push({ + testid: `${site?.sitename}-link`, name: `${site?.title} site`, href: `/${site?.sitename}`, icon: 'BackArrow', @@ -154,6 +160,7 @@ const secondaryNavigationItems = (sites) => { {secondaryNavigation.map((item) => ( diff --git a/src/components/DashboardCategories/DashboardCategoriesData.js b/src/components/DashboardCategories/DashboardCategoriesData.js index a75f1dcb..b2269fcd 100644 --- a/src/components/DashboardCategories/DashboardCategoriesData.js +++ b/src/components/DashboardCategories/DashboardCategoriesData.js @@ -15,6 +15,7 @@ function DashboardCategoriesData() { const tileContent = [ { + testid: 'create-category-link', icon: 'Create', name: 'Add a Category', description: 'Add a new category to your dictionary', diff --git a/src/components/DashboardCreate/DashboardCreateData.js b/src/components/DashboardCreate/DashboardCreateData.js index 1e6a0ff5..2256a932 100644 --- a/src/components/DashboardCreate/DashboardCreateData.js +++ b/src/components/DashboardCreate/DashboardCreateData.js @@ -15,6 +15,7 @@ function DashboardCreateData({ urlPrefix = '' }) { const createTiles = { WORD: { + testid: 'create-word-link', icon: 'Word', name: 'Create a word', description: 'Add a new word to your dictionary', @@ -23,6 +24,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, PHRASE: { + testid: 'create-phrase-link', icon: 'Phrase', name: 'Create a phrase', description: 'Add a new phrase to your dictionary', @@ -31,6 +33,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, SONG: { + testid: 'create-song-link', icon: 'Song', name: 'Create a song', description: 'Add a new song to your site', @@ -39,6 +42,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, STORY: { + testid: 'create-story-link', icon: 'Story', name: 'Create a story', description: 'Add a new story to your site', @@ -47,6 +51,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: ASSISTANT, }, SPEAKER: { + testid: 'create-speaker-link', icon: 'Speak', name: 'Add a speaker', description: 'Add a new speaker to your site', @@ -55,6 +60,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: EDITOR, }, CATEGORY: { + testid: 'create-category-link', icon: 'Category', name: 'Add a category', description: 'Add a new category to your dictionary', @@ -63,6 +69,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, WIDGET: { + testid: 'create-widget-link', icon: 'Widget', name: 'Create a widget', description: "Add a new widget to your site's collection", @@ -71,6 +78,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, PAGE: { + testid: 'create-page-link', icon: 'WebPages', name: 'Create a custom page', description: 'Add a new page to your site', @@ -79,6 +87,7 @@ function DashboardCreateData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, GALLERY: { + testid: 'create-gallery-link', icon: 'Images', name: 'Create a gallery', description: 'Add a new image gallery to your site', diff --git a/src/components/DashboardEdit/DashboardEditData.js b/src/components/DashboardEdit/DashboardEditData.js index 32368e93..36cffede 100644 --- a/src/components/DashboardEdit/DashboardEditData.js +++ b/src/components/DashboardEdit/DashboardEditData.js @@ -29,6 +29,7 @@ function DashboardEditData({ urlPrefix = '' }) { const editTiles = { WORDS: { + testid: 'edit-words-link', icon: 'Word', name: 'Edit words', description: 'Edit the words in your dictionary', @@ -43,6 +44,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, PHRASES: { + testid: 'edit-phrases-link', icon: 'Phrase', name: 'Edit phrases', description: 'Edit the phrases in your dictionary', @@ -57,6 +59,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, SONGS: { + testid: 'edit-songs-link', icon: 'Song', name: 'Edit songs', description: 'Edit the songs on your site', @@ -71,6 +74,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, STORIES: { + testid: 'edit-stories-link', icon: 'Story', name: 'Edit stories', description: 'Edit the stories on your site', @@ -85,6 +89,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: ASSISTANT, }, SPEAKERS: { + testid: 'edit-speakers-link', icon: 'Speak', name: 'Edit speakers', description: 'Edit the speakers on your site', @@ -93,6 +98,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: EDITOR, }, CATEGORIES: { + testid: 'edit-categories-link', icon: 'Categories', name: 'Edit categories', description: @@ -102,6 +108,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, WIDGETS: { + testid: 'edit-widgets-link', icon: 'Widget', name: 'Edit widgets', description: 'Manage and edit the widgets on your site', @@ -110,6 +117,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, PAGES: { + testid: 'edit-pages-link', icon: 'WebPages', name: 'Edit custom pages', description: 'Manage and edit the custom pages on your site', @@ -118,6 +126,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, HOMEPAGE: { + testid: 'edit-homepage-link', icon: 'Home', name: 'Edit homepage', description: 'Edit the main homepage for your site', @@ -126,6 +135,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, ALPHABET: { + testid: 'edit-alphabet-link', icon: 'Alphabet', name: 'Edit alphabet', description: @@ -135,6 +145,7 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, IMMERSION: { + testid: 'edit-immersion-link', icon: 'Translate', name: 'Edit Immersion Labels', description: 'Update the labels used in immersion mode on your site', @@ -143,8 +154,9 @@ function DashboardEditData({ urlPrefix = '' }) { auth: LANGUAGE_ADMIN, }, GALLERY: { + testid: 'edit-galleries-link', icon: 'Images', - name: 'Edit a gallery', + name: 'Edit galleries', description: 'Edit an image gallery on your site', href: addUrlPrefix('galleries'), iconColor: 'blumine-900', diff --git a/src/components/DashboardGalleries/DashboardGalleriesData.js b/src/components/DashboardGalleries/DashboardGalleriesData.js index 293c9501..c1231a4a 100644 --- a/src/components/DashboardGalleries/DashboardGalleriesData.js +++ b/src/components/DashboardGalleries/DashboardGalleriesData.js @@ -14,6 +14,7 @@ function DashboardGalleriesData() { const tileContent = [ { + testid: 'create-gallery-link', icon: 'Create', name: 'Create a Gallery', description: 'Add a new image gallery to your site', diff --git a/src/components/DashboardMedia/DashboardMediaData.js b/src/components/DashboardMedia/DashboardMediaData.js index d4de914c..c6ac3354 100644 --- a/src/components/DashboardMedia/DashboardMediaData.js +++ b/src/components/DashboardMedia/DashboardMediaData.js @@ -6,6 +6,7 @@ function DashboardMediaData() { const tileContent = [ { + testid: 'dashboard-audio-link', icon: 'Microphone', name: 'Audio', description: 'Manage your audio files', @@ -13,6 +14,7 @@ function DashboardMediaData() { iconColor: 'scarlet-900', }, { + testid: 'dashboard-images-link', icon: 'Images', name: 'Images', description: 'Manage your images', @@ -20,6 +22,7 @@ function DashboardMediaData() { iconColor: 'blumine-800', }, { + testid: 'dashboard-videos-link', icon: 'Video', name: 'Videos', description: 'Manage your videos', diff --git a/src/components/DashboardPages/DashboardPagesData.js b/src/components/DashboardPages/DashboardPagesData.js index 8cc7972e..ae41d498 100644 --- a/src/components/DashboardPages/DashboardPagesData.js +++ b/src/components/DashboardPages/DashboardPagesData.js @@ -14,6 +14,7 @@ function DashboardPagesData() { const tileContent = [ { + testid: 'edit-homepage-link', icon: 'Home', name: 'Edit Homepage', description: 'Edit the main homepage for your site', @@ -22,6 +23,7 @@ function DashboardPagesData() { auth: LANGUAGE_ADMIN, }, { + testid: 'create-page-link', icon: 'Create', name: 'Create a Custom Page', description: 'Add a new page to your site', diff --git a/src/components/DashboardReports/DashboardReportsData.js b/src/components/DashboardReports/DashboardReportsData.js index 3b0b3352..2569a41a 100644 --- a/src/components/DashboardReports/DashboardReportsData.js +++ b/src/components/DashboardReports/DashboardReportsData.js @@ -21,6 +21,7 @@ function DashboardReportsData() { const tileContent = [ { + testid: 'advanced-search-link', icon: 'Wrench', name: 'Build your own', description: 'Use the advanced search filters to create your own report', @@ -32,6 +33,7 @@ function DashboardReportsData() { const reportTiles = [ { + testid: 'report-created-link', icon: 'Star', name: 'Recently created', description: 'New words and phrases at the top', @@ -40,6 +42,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-modified-link', icon: 'Pencil', name: 'Recently modified', description: 'Recently edited words and phrases at the top', @@ -48,6 +51,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-no-audio-link', icon: 'MicrophoneOff', name: 'No audio', description: 'Words and phrases without audio files', @@ -56,6 +60,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-no-images-link', icon: 'ImagesNone', name: 'No images', description: 'Words and phrases without images', @@ -64,6 +69,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-team-link', icon: 'Team', name: 'Team content', description: 'Content only available to the language team', @@ -72,6 +78,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-members-link', icon: 'Members', name: 'Members only content', description: 'Content only available to site members', @@ -80,6 +87,7 @@ function DashboardReportsData() { auth: ASSISTANT, }, { + testid: 'report-public-link', icon: 'Public', name: 'Public content', description: 'Content available to the general public', diff --git a/src/components/DashboardSpeakers/DashboardSpeakersData.js b/src/components/DashboardSpeakers/DashboardSpeakersData.js index 92c353f2..091d7ed2 100644 --- a/src/components/DashboardSpeakers/DashboardSpeakersData.js +++ b/src/components/DashboardSpeakers/DashboardSpeakersData.js @@ -12,6 +12,7 @@ function DashboardSpeakersData() { const tileContent = [ { + testid: 'create-speaker-link', icon: 'Create', name: 'Add a Speaker', description: 'Add a new speaker to your site', diff --git a/src/components/DashboardTiles/DashboardTilesPresentation.js b/src/components/DashboardTiles/DashboardTilesPresentation.js index 057e887d..13d83917 100644 --- a/src/components/DashboardTiles/DashboardTilesPresentation.js +++ b/src/components/DashboardTiles/DashboardTilesPresentation.js @@ -63,6 +63,7 @@ function DashboardTilesPresentation({ tileContent }) {

{tile?.externalLink ? ( ) : ( - + {/* Extend touch target to entire panel */}