Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(cypress): fixes and unskips for tests #3035

Merged
merged 3 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 34 additions & 43 deletions cypress/integration/chat-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,6 @@ describe('Chat Features Tests', () => {
.should('contain', '(edited)')
})

it('Chat - Verify when clicking on Send Money, coming soon appears', () => {
// Hover over on Send Money and Coming Soon tooltip will appear when clicking on its button
cy.hoverOnComingSoonIcon(
'#chatbar-controls > span > .tooltip-container',
'Send Money\nComing Soon',
)
})

it('Chat - Verify when clicking on Emoji, the emoji picker appears', () => {
// Emoji picker is displayed when clicking on its button
cy.get('#emoji-toggle').click()
cy.get('.navbar > .button-group > .active > #custom-cursor-area').should(
'contain',
'Emoji',
)
cy.get('#emoji-toggle').click()
})

it('Chat - Verify when clicking on Glyphs, the glyphs picker appears', () => {
// Glyphs picker is displayed when clicking on its button
cy.get('#glyph-toggle').click()
cy.get('.pack-list > .is-text').should('contain', 'Try using some glyphs')
cy.get('#glyph-toggle').click()
})

it('Chat - Copy paste text', () => {
// Allowing Chrome Browser to have read and write access to clipboard
cy.wrap(
Expand Down Expand Up @@ -129,9 +104,40 @@ describe('Chat Features Tests', () => {
cy.get('.file-info > .title').should('contain', 'logo.png')
})

it('Chat - Verify when clicking on Send Money, coming soon appears', () => {
// Hover over on Send Money and Coming Soon tooltip will appear when clicking on its button
cy.hoverOnComingSoonIcon(
'#chatbar-controls > span > .tooltip-container',
'Send Money\nComing Soon',
)
})

it('Chat - Verify when clicking on Emoji, the emoji picker appears', () => {
// Emoji picker is displayed when clicking on its button
cy.get('#emoji-toggle').click()
cy.get('.navbar > .button-group > .active > #custom-cursor-area').should(
'contain',
'Emoji',
)
cy.get('#emoji-toggle').click()
})

it('Chat - Verify when clicking on Glyphs, the glyphs picker appears', () => {
// Glyphs picker is displayed when clicking on its button
cy.get('#glyph-toggle').click()
cy.get('.pack-list > .is-text').should('contain', 'Try using some glyphs')
cy.get('#glyph-toggle').click()
})

it('Chat - Validate User ID can be copied when clicked on it', () => {
// Moving this at the end of execution to avoid issues on CI when running chat tests
cy.get('[data-cy=toggle-sidebar]').click()
//Click on toggle-sidebar only if app is collapsed
cy.get('#app-wrap').then(($appWrap) => {
if ($appWrap.hasClass('is-collapsed')) {
cy.get('[data-cy=toggle-sidebar]').click()
}
})

//Start validation
cy.chatFeaturesProfileName('cypress')
cy.get('[data-cy=hamburger-button]').click()
})
Expand Down Expand Up @@ -204,7 +210,7 @@ describe('Chat Features Tests', () => {
cy.get('[data-cy=chat-search-result]').find('.close-button').click()
})

it('Chat - Search - Results - Pagination is NOT displayed when 10 or less matches are found', () => {
it.skip('Chat - Search - Results - Pagination is NOT displayed when 10 or less matches are found', () => {
//Search for a random number and assert results
cy.searchFromTextInChat(randomNumber)
cy.assertFirstMatchOnSearch(randomNumber)
Expand All @@ -213,19 +219,4 @@ describe('Chat Features Tests', () => {
cy.get('[data-cy=chat-search-result-pagination]').should('not.exist')
cy.get('[data-cy=chat-search-result]').find('.close-button').click()
})

it('Chat - Files - Rename Folder', () => {
//Click on toggle button and then on files
cy.get('[data-cy=toggle-sidebar]').click()

//Open files screen and rename existing folder
cy.openFilesScreen()
cy.renameFileOrFolder('test-folder-' + randomNumber, 'folder')
})

it.skip('Chat - Files - Rename Files', () => {
//Open files screen and rename existing file
cy.openFilesScreen()
cy.renameFileOrFolder('test-file-' + randomNumber, 'file')
})
})
2 changes: 1 addition & 1 deletion cypress/integration/chat-glyphs-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const randomPIN = faker.internet.password(7, false, /[A-Z]/, 'test') // generate
const recoverySeed =
'useful wedding venture reopen forest lawsuit essence hamster kitchen bundle level tower{enter}'

describe.skip('Chat - Sending Glyphs Tests', () => {
describe('Chat - Sending Glyphs Tests', () => {
it('Send a glyph on chat', () => {
//Import account
cy.importAccount(randomPIN, recoverySeed)
Expand Down
55 changes: 37 additions & 18 deletions cypress/integration/chat-text-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let urlToValidate = 'https://www.satellite.im'
let urlToValidateTwo = 'http://www.satellite.im'
let urlToValidateThree = 'www.satellite.im'

describe('Chat Text and Sending Links Validations', () => {
describe.skip('Chat Text and Sending Links Validations', () => {
it('Message with more than 2048 chars - Counter get reds', () => {
//Import account
cy.importAccount(randomPIN, recoverySeed)
Expand All @@ -24,6 +24,7 @@ describe('Chat Text and Sending Links Validations', () => {
pasteType: 'text',
pastePayload: longMessage,
})
.should('have.text', longMessage)
let expectedMessage = longMessage.length.toString() + '/2048'
cy.validateCharlimit(expectedMessage, true)
})
Expand All @@ -35,7 +36,11 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('Attempt to send empty message with a space', () => {
cy.get('[data-cy=editable-input]').trigger('input').clear().type(' ')
cy.get('[data-cy=editable-input]')
.trigger('input')
.clear()
.type(' ')
.should('have.text', ' ')
cy.validateCharlimit('1/2048', false)
cy.get('[data-cy=send-message]').click()
cy.get('[data-cy=editable-input]').should('have.text', '')
Expand All @@ -49,7 +54,11 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('Chat Text Validation - Space counts only for 1 char', () => {
cy.get('[data-cy=editable-input]').trigger('input').clear().type(' ')
cy.get('[data-cy=editable-input]')
.trigger('input')
.clear()
.type(' ')
.should('have.text', ' ')
cy.validateCharlimit('1/2048', false)
cy.get('[data-cy=editable-input]').clear()
cy.validateCharlimit('0/2048', false)
Expand All @@ -62,10 +71,13 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('Sending a link with format https://wwww', () => {
cy.get('[data-cy=editable-input]').trigger('input').paste({
pasteType: 'text',
pastePayload: urlToValidate,
})
cy.get('[data-cy=editable-input]')
.trigger('input')
.paste({
pasteType: 'text',
pastePayload: urlToValidate,
})
.should('have.text', urlToValidate)
cy.validateCharlimit('24/2048', false)
cy.get('[data-cy=send-message]').click()
let locatorURL = 'a[href="' + urlToValidate + '"]'
Expand All @@ -77,10 +89,13 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('Sending a link with format http://wwww', () => {
cy.get('[data-cy=editable-input]').trigger('input').paste({
pasteType: 'text',
pastePayload: urlToValidateTwo,
})
cy.get('[data-cy=editable-input]')
.trigger('input')
.paste({
pasteType: 'text',
pastePayload: urlToValidateTwo,
})
.should('have.text', urlToValidateTwo)
cy.validateCharlimit('23/2048', false)
cy.get('[data-cy=send-message]').click()
let locatorURL = 'a[href="' + urlToValidateTwo + '"]'
Expand All @@ -92,10 +107,13 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('Sending a text with format wwww. will not send it as link', () => {
cy.get('[data-cy=editable-input]').trigger('input').paste({
pasteType: 'text',
pastePayload: urlToValidateThree,
})
cy.get('[data-cy=editable-input]')
.trigger('input')
.paste({
pasteType: 'text',
pastePayload: urlToValidateThree,
})
.should('have.text', urlToValidateThree)
cy.validateCharlimit('16/2048', false)
cy.get('[data-cy=send-message]').click()
cy.contains(urlToValidateThree)
Expand All @@ -121,15 +139,15 @@ describe('Chat Text and Sending Links Validations', () => {
})

it('User should be able to use "" to escape in chat', () => {
cy.sendMessageWithEscapeOrAutolink('*To Do')
cy.chatFeaturesSendMessage('*To Do', false)
cy.get('[data-cy=chat-message]')
.last()
.scrollIntoView()
.should('have.text', '*To Do')
})

it('User should be able to use "\\" to write a single "" in chat', () => {
cy.sendMessageWithEscapeOrAutolink('\\*To Do')
cy.chatFeaturesSendMessage('\\*To Do', false)
cy.get('[data-cy=chat-message]')
.last()
.scrollIntoView()
Expand All @@ -150,7 +168,8 @@ describe('Chat Text and Sending Links Validations', () => {

it('User should use markdown "<>" to insert an autolink', () => {
let locatorURL = 'a[href="' + randomURL + '"]'
cy.sendMessageWithEscapeOrAutolink('<' + randomURL + '>')
let autolink = '<' + randomURL + '>'
cy.chatFeaturesSendMessage(autolink, false)
cy.get(locatorURL).last().scrollIntoView().should('have.attr', 'href')
})

Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/chat-top-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const randomPIN = faker.internet.password(7, false, /[A-Z]/, 'test') // generate
const recoverySeed =
'useful wedding venture reopen forest lawsuit essence hamster kitchen bundle level tower{enter}'

describe.skip('Chat Toolbar Tests', () => {
describe('Chat Toolbar Tests', () => {
it('Chat - Toolbar - Validate audio icon is displayed', () => {
//Import account
cy.importAccount(randomPIN, recoverySeed)
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/create-account-negative-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Create Account - Negative Tests', () => {
cy.contains('Pin must be at least 5 characters.')
})

it.skip('Try to create account without username', () => {
it('Try to create account without username', () => {
//Enter PIN screen
cy.createAccountPINscreen(randomPIN)

Expand All @@ -30,7 +30,7 @@ describe('Create Account - Negative Tests', () => {
cy.contains('Username must be at least 5 characters.')
})

it.skip('Try to create account with NSFW image', () => {
it('Try to create account with NSFW image', () => {
//Enter PIN screen
cy.createAccountPINscreen(randomPIN)

Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/create-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const randomName = faker.internet.userName(name) // generate random name
const randomStatus = faker.lorem.word() // generate random status
const randomPIN = faker.internet.password(7, false, /[A-Z]/, 'test') // generate random PIN

describe.skip('Create Account Validations', () => {
describe('Create Account Validations', () => {
Cypress.on('uncaught:exception', (err, runnable) => false) // temporary until AP-48 gets fixed
it('Create Account', () => {
//Enter PIN screen
Expand Down Expand Up @@ -80,7 +80,7 @@ describe.skip('Create Account Validations', () => {
cy.createAccountSubmit()
})

it('Create account successfully without image after attempting to add a NSFW picture', () => {
it.skip('Create account successfully without image after attempting to add a NSFW picture', () => {
//Creating pin
cy.createAccountPINscreen(randomPIN)

Expand Down
34 changes: 34 additions & 0 deletions cypress/integration/files-features.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 recoverySeed =
'useful wedding venture reopen forest lawsuit essence hamster kitchen bundle level tower{enter}'

describe('Files Features Tests', () => {
it('Chat - Files - Rename Folder', () => {
// Import account
cy.importAccount(randomPIN, recoverySeed)

// Validate profile name displayed
cy.validateChatPageIsLoaded()

// Validate message is sent
cy.goToConversation('cypress friend')

//Click on toggle button and then on files
cy.get('[data-cy=toggle-sidebar]').click()

//Open files screen and rename existing folder
cy.openFilesScreen()
cy.renameFileOrFolder('test-folder-' + randomNumber, 'folder')
})

it('Chat - Files - Rename Files', () => {
//Wait until loading spinner disappears
cy.get('.spinner', { timeout: 30000 }).should('not.exist')

//Open files screen and rename existing file
cy.openFilesScreen()
cy.renameFileOrFolder('test-file-' + randomNumber, 'file')
})
})
2 changes: 1 addition & 1 deletion cypress/integration/mobiles-responsiveness.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Run responsiveness tests on several devices', () => {
Cypress.config('pageLoadTimeout', 180000) //adding more time for pageLoadTimeout only for this spec
Cypress.on('uncaught:exception', (err, runnable) => false) // to bypass Module build failed: Error: ENOENT: No such file or directory issue randomly presented
data.allDevices.forEach((item) => {
it.skip(`Create Account on ${item.description}`, () => {
it(`Create Account on ${item.description}`, () => {
cy.viewport(item.width, item.height)
cy.createAccountPINscreen(randomPIN)

Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/pin-unlock-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const userPassphrase =
'useful wedding venture reopen forest lawsuit essence hamster kitchen bundle level tower'
const randomPIN = faker.internet.password(7, false, /[A-Z]/, 'test') // generate random PIN

describe.skip('Unlock pin should be persisted when store pin is enabled', () => {
describe('Unlock pin should be persisted when store pin is enabled', () => {
it('Create Account with store pin disabled', () => {
//Go to URL, add a PIN and make sure that toggle for save pin is disabled
cy.createAccountPINscreen(randomPIN, false, false)
Expand All @@ -24,7 +24,7 @@ describe.skip('Unlock pin should be persisted when store pin is enabled', () =>
})
})

it('Create Account with store pin enabled', () => {
it.skip('Create Account with store pin enabled', () => {
//Go to URL, add a PIN and make sure that toggle for save pin is enabled
cy.createAccountPINscreen(randomPIN, true, false)

Expand Down Expand Up @@ -60,7 +60,7 @@ describe.skip('Unlock pin should be persisted when store pin is enabled', () =>
})
})

it('Import Account with store pin enabled', () => {
it.skip('Import Account with store pin enabled', () => {
//Go to URL, add a PIN and make sure that toggle for save pin is enabled
cy.importAccountPINscreen(randomPIN, true, false)

Expand Down
Loading