Skip to content

Commit

Permalink
Update tag to test
Browse files Browse the repository at this point in the history
  • Loading branch information
ltthienn committed Sep 29, 2023
1 parent acc8209 commit 00fac6c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cypress/e2e/specs/csp.e2e.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import { FarmLocators, MyPoolLocators, PoolLocators } from "../selectors/selecto

const tokenCatalog = new TokenCatalog()

describe('CSP', { tags: TAG.regression }, () => {
describe('CSP', { tags: TAG.smoke }, () => {
beforeEach(() => {
cy.on('window:load', (win) => cy.stub(win.console, 'log').as('log'))
SwapPage.open(DEFAULT_URL)
})

describe('Search token in Token Catalog', { tags: TAG.regression }, () => {
describe('Search token in Token Catalog', () => {
beforeEach(() => {
SwapPage.selectTokenIn()
})
it('injecting <script> tag does not work', () => {
tokenCatalog.searchToken('KNC<img src="" onerror="console.log(`hacked`)" />')
tokenCatalog.searchToken('KNC<img src="" onerror="console.log(`failed`)" />')
cy.get('@log').should('not.have.been.called')
})

Expand All @@ -28,15 +28,15 @@ describe('CSP', { tags: TAG.regression }, () => {
})
})

describe('Search token in Pools Page', { tags: TAG.regression }, () => {
describe('Search token in Pools Page', () => {
beforeEach(() => {
SwapPage.goToPoolPage()
})
it('injecting <script> tag does not work', () => {
cy.get(PoolLocators.txtSearch, { timeout: 10000 })
.should('be.visible')
.click()
.type('KNC<img src="" onerror="console.log(`hacked`)" />')
.type('KNC<img src="" onerror="console.log(`failed`)" />')
cy.get('@log').should('not.have.been.called')
})

Expand All @@ -49,15 +49,15 @@ describe('CSP', { tags: TAG.regression }, () => {
})
})

describe('Search token in My Pools Page', { tags: TAG.regression }, () => {
describe('Search token in My Pools Page', () => {
beforeEach(() => {
SwapPage.goToMyPoolsPage()
})
it('injecting <script> tag does not work', () => {
cy.get(MyPoolLocators.txtSearch, { timeout: 10000 })
.should('be.visible')
.click()
.type('KNC<img src="" onerror="console.log(`hacked`)" />')
.type('KNC<img src="" onerror="console.log(`failed`)" />')
cy.get('@log').should('not.have.been.called')
})

Expand All @@ -71,15 +71,15 @@ describe('CSP', { tags: TAG.regression }, () => {

})

describe('Search token in Farms Page', { tags: TAG.regression }, () => {
describe('Search token in Farms Page', () => {
beforeEach(() => {
SwapPage.goToFarmPage()
})
it('injecting <script> tag does not work', () => {
cy.get(FarmLocators.txtSearch, { timeout: 10000 })
.should('be.visible')
.click()
.type('KNC<img src="" onerror="console.log(`hacked`)" />')
.type('KNC<img src="" onerror="console.log(`failed`)" />')
cy.get('@log').should('not.have.been.called')
})

Expand Down

0 comments on commit 00fac6c

Please sign in to comment.