diff --git a/cypress/integration-pair-chat/chat-first-user.js b/cypress/integration-pair-chat/chat-first-user.js index 803f7a8dc8..7533953f5d 100644 --- a/cypress/integration-pair-chat/chat-first-user.js +++ b/cypress/integration-pair-chat/chat-first-user.js @@ -43,7 +43,7 @@ describe('Chat features with two accounts at the same time - First User', () => cy.contains('Chat User A', { timeout: 300000 }).should('be.visible') //Attempt 3 times to ensure that if first account loads before, second account will see the typing indicator for (let times = 0; times < 3; times++) { - cy.get('.messageuser').should('be.visible').type(longMessage).clear() + cy.get('.editable-input').should('be.visible').type(longMessage).clear() } }) }) diff --git a/cypress/integration/chat-features.js b/cypress/integration/chat-features.js index 4bd7847f16..ee876d2eb7 100644 --- a/cypress/integration/chat-features.js +++ b/cypress/integration/chat-features.js @@ -2,8 +2,11 @@ const faker = require('faker') const randomPIN = faker.internet.password(7, false, /[A-Z]/, 'test') // generate random PIN const randomNumber = faker.datatype.number() // generate random number const randomMessage = faker.lorem.sentence() // generate random sentence +const imageLocalPath = 'cypress/fixtures/images/logo.png' +const randomTextToCopy = faker.lorem.sentence() // generate random sentence const recoverySeed = 'boring over tilt regret diamond rubber example there fire roof sheriff always{enter}' +let imageURL describe('Chat Features Tests', () => { it('Chat - Send stuff on chat', () => { @@ -17,6 +20,7 @@ describe('Chat Features Tests', () => { cy.get('.toggle-sidebar').should('be.visible').click() //Validate message and emojis are sent + cy.waitForMessagesToLoad() cy.chatFeaturesSendMessage(randomMessage) cy.chatFeaturesSendEmoji('[title="smile"]', '😄') @@ -48,4 +52,77 @@ describe('Chat Features Tests', () => { cy.get('.pack-list > .is-text').should('contain', 'Try using some glyphs') cy.get('#glyph-toggle').click() }) + + it('Chat - Copy paste text', () => { + //Sending another random message to validate the scenario + cy.chatFeaturesSendMessage(randomTextToCopy) + + // Allowing Chrome Browser to have read and write access to clipboard + cy.wrap( + Cypress.automation('remote:debugger:protocol', { + command: 'Browser.grantPermissions', + params: { + permissions: ['clipboardReadWrite', 'clipboardSanitizedWrite'], + //make the permission trigger by allowing the current origin only + origin: window.location.origin, + }, + }), + ) + + //Ensuring permissions for read were granted + cy.window() + .its('navigator.permissions') + .invoke('query', { name: 'clipboard-read' }) + .its('state') + .should('equal', 'granted') + + //Copying the latest text message sent + cy.get('[data-cy=chat-message]').last().rightclick() + cy.contains('Copy Message').realClick() + + //Validating that text messsage copied matches with actual clipboard value + cy.window() + .its('navigator.clipboard') + .invoke('readText') + .should('equal', randomTextToCopy) + .then((clipboardText) => { + //Simulating the paste event through a cypress command passing the clipboard data + cy.get('.editable-input').realClick().paste({ + pasteType: 'text', + pastePayload: clipboardText, + }) + }) + //Validating that editable input text matches with pasted value + cy.get('.editable-input').should('have.text', randomTextToCopy) + }) + + it.skip('Chat - Copy paste images - Test skipped until AP-1080 bug is fixed', () => { + //Test skipped until AP-1080 bug is fixed + //Send an image in chat + cy.chatFeaturesSendImage(imageLocalPath) + + //Copying the latest image URL sent + cy.get('[data-cy=chat-image]') + .last() + .invoke('attr', 'src') + .then((imgSrcValue) => { + imageURL = imgSrcValue + }) + cy.get('[data-cy=chat-image]').last().rightclick() + cy.contains('Copy Image').realClick() + + //Simulating paste event through a cypress command passing the clipboard image URL data + cy.window() + .its('navigator.clipboard') + .invoke('read') + .then((clipboardImageURL) => { + cy.get('.editable-input').realClick().paste({ + pasteType: 'url', + pastePayload: clipboardImageURL, + }) + }) + //Validating that preview of image is displayed and matches with image filename copied from clipboard + cy.get('.file-item').should('be.visible') + cy.get('.file-info > .title').should('contain', 'logo.png') + }) }) diff --git a/cypress/integration/chat-pair-features.js b/cypress/integration/chat-pair-features.js index f36b2a85be..a773652beb 100644 --- a/cypress/integration/chat-pair-features.js +++ b/cypress/integration/chat-pair-features.js @@ -21,6 +21,7 @@ describe('Chat features with two accounts - First User', () => { }) it('Send message to user B', () => { + cy.waitForMessagesToLoad() cy.chatFeaturesSendMessage(randomMessage) cy.contains(randomMessage).last().scrollIntoView().should('be.visible') }) @@ -75,6 +76,8 @@ describe('Chat features with two accounts - First User', () => { }) it('Assert message received from user A', () => { + //Adding assertion to validate that messages are displayed + cy.waitForMessagesToLoad() cy.contains(randomMessage).last().scrollIntoView().should('be.visible') }) diff --git a/cypress/integration/mobiles-responsiveness.js b/cypress/integration/mobiles-responsiveness.js index e0a4ef46df..06b6c6a7d1 100644 --- a/cypress/integration/mobiles-responsiveness.js +++ b/cypress/integration/mobiles-responsiveness.js @@ -58,6 +58,7 @@ describe('Run responsiveness tests on several devices', () => { cy.get('.toggle-sidebar').should('be.visible').click() //Validate message and emojis are sent + cy.waitForMessagesToLoad() cy.chatFeaturesSendMessage(randomMessage) cy.chatFeaturesSendEmoji('[title="smile"]', '😄') diff --git a/cypress/integration/snapshots-test.js b/cypress/integration/snapshots-test.js index b1628a2cbe..6868376ad4 100644 --- a/cypress/integration/snapshots-test.js +++ b/cypress/integration/snapshots-test.js @@ -33,11 +33,17 @@ describe('Snapshots Testing', () => { }) it('Import account - Buffering screen', () => { - cy.snapshotTestContains('Linking Satellites...', 60000) + cy.contains('Linking Satellites...').should('be.visible') + cy.snapshotTestContains( + 'Aligning satellites to retrieve your account', + 60000, + ) }) it('Import account - Main Screen Loaded', () => { - cy.snapshotTestContains('SnapQA', 60000) + cy.contains('SnapQA', { timeout: 60000 }) + cy.get('body').realClick({ position: 'topLeft' }) + cy.snapshotTestContains('SnapQA') }) it('Import account - Go to files', () => { @@ -158,6 +164,9 @@ describe('Snapshots Testing', () => { //User input fill and finishing account creation cy.createAccountUserInput(randomName, randomStatus) cy.createAccountSubmit() - cy.snapshotTestContains('Linking Satellites...', 20000) + cy.snapshotTestContains( + 'Aligning satellites to retrieve your account...', + 20000, + ) }) }) diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png deleted file mode 100644 index 18aa40b75c..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png deleted file mode 100644 index 2e4e699687..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - PIN screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - PIN screen.snap.png deleted file mode 100644 index b9b151d91d..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - PIN screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png deleted file mode 100644 index 6c67f79cdc..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - User Input Screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - User Input Screen.snap.png deleted file mode 100644 index aeca5d09a5..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Create Account - User Input Screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Buffering screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Buffering screen.snap.png deleted file mode 100644 index 18aa40b75c..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Buffering screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on emojis.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on emojis.snap.png deleted file mode 100644 index f886e51d6b..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on emojis.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on glyphs.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on glyphs.snap.png deleted file mode 100644 index 0cd7c2f930..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Click on glyphs.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png deleted file mode 100644 index 2e4e699687..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Enter passphrase screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Enter passphrase screen.snap.png deleted file mode 100644 index b5e8f2ec44..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Enter passphrase screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to a chat.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to a chat.snap.png deleted file mode 100644 index 84d2dd1651..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to a chat.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to files.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to files.snap.png deleted file mode 100644 index 78ffa8a230..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to files.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to friends.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to friends.snap.png deleted file mode 100644 index 51cecd67c9..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Go to friends.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Main Screen Loaded.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Main Screen Loaded.snap.png deleted file mode 100644 index 4aa00a9a16..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Main Screen Loaded.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - PIN screen.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - PIN screen.snap.png deleted file mode 100644 index b9b151d91d..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - PIN screen.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png deleted file mode 100644 index 09eac7bb5f..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png deleted file mode 100644 index 6c8505d0b3..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png deleted file mode 100644 index 5944f18109..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png deleted file mode 100644 index e63f963735..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png deleted file mode 100644 index 9532fe7b56..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png deleted file mode 100644 index 341bb530d1..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png deleted file mode 100644 index 0f437c37cd..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Profile.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Profile.snap.png deleted file mode 100644 index e42ca7ecf9..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - General - Profile.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png deleted file mode 100644 index 4e408609bd..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png deleted file mode 100644 index f8847c0597..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png and /dev/null differ diff --git a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png b/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png deleted file mode 100644 index d40a84aced..0000000000 Binary files a/cypress/snapshots/All Integration Specs/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png and /dev/null differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png new file mode 100644 index 0000000000..62806a6e8e Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Buffering screen after submission.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png new file mode 100644 index 0000000000..8cc6bfc8c8 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Create or Import Account Selection screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - PIN screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - PIN screen.snap.png new file mode 100644 index 0000000000..e426eb939e Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - PIN screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png new file mode 100644 index 0000000000..4285ac79d4 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - Privacy Settings screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - User Input Screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - User Input Screen.snap.png new file mode 100644 index 0000000000..80c3a8d30b Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Create Account - User Input Screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Buffering screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Buffering screen.snap.png new file mode 100644 index 0000000000..62806a6e8e Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Buffering screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on emojis.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on emojis.snap.png new file mode 100644 index 0000000000..59a0ae951a Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on emojis.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on glyphs.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on glyphs.snap.png new file mode 100644 index 0000000000..a5406d12d0 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Click on glyphs.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png new file mode 100644 index 0000000000..8cc6bfc8c8 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Create or Import Account Selection screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Enter passphrase screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Enter passphrase screen.snap.png new file mode 100644 index 0000000000..2c84eb2e32 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Enter passphrase screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to a chat.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to a chat.snap.png new file mode 100644 index 0000000000..e421095eec Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to a chat.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to files.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to files.snap.png new file mode 100644 index 0000000000..33cb421734 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to files.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to friends.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to friends.snap.png new file mode 100644 index 0000000000..0118cad43d Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Go to friends.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Main Screen Loaded.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Main Screen Loaded.snap.png new file mode 100644 index 0000000000..e421095eec Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Main Screen Loaded.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - PIN screen.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - PIN screen.snap.png new file mode 100644 index 0000000000..e426eb939e Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - PIN screen.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png new file mode 100644 index 0000000000..b5c773413d Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Screen after adding recovery seed.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png new file mode 100644 index 0000000000..ade0a3108a Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Developer - App Info.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png new file mode 100644 index 0000000000..0ba5b4fb8b Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Accounts & Devices.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png new file mode 100644 index 0000000000..5fb277925b Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Audio & Video.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png new file mode 100644 index 0000000000..6cc78c1d0c Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Keybinds.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png new file mode 100644 index 0000000000..87f1904971 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Personalize.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png new file mode 100644 index 0000000000..c9af1d2bef Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Privacy.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Profile.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Profile.snap.png new file mode 100644 index 0000000000..432ef8afd4 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - General - Profile.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png new file mode 100644 index 0000000000..9414bb1fca Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Network.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png new file mode 100644 index 0000000000..73aa2f50cf Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Realms.snap.png differ diff --git a/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png new file mode 100644 index 0000000000..711a692262 Binary files /dev/null and b/cypress/snapshots/snapshots-test.js/Snapshots Testing -- Import account - Settings - Realms & Security - Storage.snap.png differ diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 1d6b12251f..f20c2e9326 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -34,14 +34,10 @@ for (const command of [ //Command to retry visiting root page when previous PIN data is not cleared correctly Cypress.Commands.add('visitRootPage', () => { - cy.window().then((win) => { - win.sessionStorage.clear() - }) - cy.clearCookies() - cy.clearLocalStorage() cy.visit('/') - cy.url().then(($url) => { - if (!($url === redirectedURL)) { + cy.get('[data-cy=pin-label]').then(($label) => { + // retries visiting the page after deleting storage and cookies to delete stored pin + if ($label.text() === 'Decrypt Account') { cy.window().then((win) => { win.sessionStorage.clear() }) @@ -250,16 +246,16 @@ Cypress.Commands.add('chatFeaturesProfileName', (value) => { }) Cypress.Commands.add('chatFeaturesSendMessage', (message) => { - cy.get('.messageuser').should('be.visible').type(message) - cy.get('.messageuser').type('{enter}') // sending text message + cy.get('.editable-input').should('be.visible').type(message, { force: true }) + cy.get('.editable-input').type('{enter}') // sending text message cy.contains(message) }) Cypress.Commands.add('chatFeaturesSendEmoji', (emojiLocator, emojiValue) => { cy.get('#emoji-toggle > .control-icon').click() cy.get(emojiLocator).click() // sending emoji - cy.get('.messageuser').click() - cy.get('.messageuser').type('{enter}') + cy.get('.editable-input').click() + cy.get('.editable-input').type('{enter}') cy.contains(emojiValue) }) @@ -278,7 +274,7 @@ Cypress.Commands.add('chatFeaturesSendGlyph', () => { cy.get('#glyph-toggle').click() cy.get('.pack-list > .is-text').should('contain', 'Try using some glyphs') cy.get('.glyph-item').first().click() - cy.get('.messageuser').click().type('{enter}') + cy.get('.editable-input').click().type('{enter}') }) Cypress.Commands.add('chatFeaturesSendImage', (imagePath) => { @@ -289,7 +285,7 @@ Cypress.Commands.add('chatFeaturesSendImage', (imagePath) => { cy.get('.file-info > .title').should('contain', 'logo.png') cy.contains('Scanning', { timeout: 120000 }).should('not.exist') cy.get('.thumbnail').should('be.visible') - cy.get('.messageuser').type('{enter}') + cy.get('.editable-input').type('{enter}') cy.get('.thumbnail', { timeout: 120000 }).should('not.exist') }) @@ -300,15 +296,22 @@ Cypress.Commands.add('chatFeaturesSendFile', (filePath) => { cy.get('.file-item').should('be.visible') cy.get('.file-info > .title').should('contain', 'test-file.txt') cy.get('.preview', { timeout: 120000 }).should('exist') - cy.get('.messageuser').type('{enter}') + cy.get('.editable-input').type('{enter}') cy.get('.preview', { timeout: 120000 }).should('not.exist') }) +Cypress.Commands.add('waitForMessagesToLoad', () => { + cy.get('[data-cy=chat-message]', { timeout: 30000 }) + .last() + .scrollIntoView() + .should('be.visible') +}) + //Version Release Notes Commands Cypress.Commands.add('releaseNotesScreenValidation', () => { cy.get('[data-cy=version]').should('be.visible').click() - cy.contains('Update').should('be.visible') + cy.contains('Update', { timeout: 30000 }).should('be.visible') cy.contains('is Here!').should('be.visible') cy.contains('Got It!').should('be.visible').click() }) @@ -345,3 +348,31 @@ Cypress.Commands.add('validatePassphraseLocalStorage', () => { expect(valueObject.accounts.phrase).to.eq('') }) }) + +// Paste Command + +Cypress.Commands.add( + 'paste', + { prevSubject: true }, + function (subject, pasteOptions) { + const { pastePayload, pasteType } = pasteOptions + const data = + pasteType === 'application/json' + ? JSON.stringify(pastePayload) + : pastePayload + // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer + const clipboardData = new DataTransfer() + clipboardData.setData(pasteType, data) + // https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event + const pasteEvent = new ClipboardEvent('paste', { + bubbles: true, + cancelable: true, + dataType: pasteType, + data, + clipboardData, + }) + subject[0].dispatchEvent(pasteEvent) + + return subject + }, +) diff --git a/pages/auth/unlock/Unlock.html b/pages/auth/unlock/Unlock.html index 4afca73d81..7a37770fde 100644 --- a/pages/auth/unlock/Unlock.html +++ b/pages/auth/unlock/Unlock.html @@ -13,6 +13,7 @@ size="small" input-kind="password" :type="`${error ? 'danger' : 'primary'}`" + :data-cy="`pin-label`" :label-text="`${getPinHash ? $t('pages.unlock.decrypt') : 'Choose Your Pin'}`" :placeholder="$t('pages.unlock.placeholder')" :loading="decrypting"