2022-12-13 19:43:02 +03:00
|
|
|
import { getTestSelector } from '../utils'
|
|
|
|
|
2023-01-30 21:09:45 +03:00
|
|
|
const PUDGY_COLLECTION_ADDRESS = '0xbd3531da5cf5857e7cfaa92426877b022e612cf8'
|
|
|
|
const BONSAI_COLLECTION_ADDRESS = '0xec9c519d49856fd2f8133a0741b4dbe002ce211b'
|
2022-12-13 19:43:02 +03:00
|
|
|
|
|
|
|
describe('Testing nfts', () => {
|
2023-01-05 19:05:05 +03:00
|
|
|
beforeEach(() => {
|
2023-03-09 22:19:45 +03:00
|
|
|
cy.visit('/')
|
2022-12-13 19:43:02 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
it('should load nft leaderboard', () => {
|
|
|
|
cy.get(getTestSelector('nft-nav')).first().click()
|
|
|
|
cy.get(getTestSelector('nft-nav')).first().should('exist')
|
|
|
|
cy.get(getTestSelector('nft-nav')).first().click()
|
|
|
|
cy.get(getTestSelector('nft-trending-collection')).its('length').should('be.gte', 25)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should load pudgy penguin collection page', () => {
|
2023-01-30 21:09:45 +03:00
|
|
|
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
|
2022-12-13 19:43:02 +03:00
|
|
|
cy.get(getTestSelector('nft-collection-asset')).should('exist')
|
|
|
|
cy.get(getTestSelector('nft-collection-filter-buy-now')).should('not.exist')
|
|
|
|
cy.get(getTestSelector('nft-filter')).first().click()
|
|
|
|
cy.get(getTestSelector('nft-collection-filter-buy-now')).should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should be able to navigate to activity', () => {
|
2023-01-30 21:09:45 +03:00
|
|
|
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
|
2022-12-13 19:43:02 +03:00
|
|
|
cy.get(getTestSelector('nft-activity')).first().click()
|
|
|
|
cy.get(getTestSelector('nft-activity-row')).should('exist')
|
|
|
|
})
|
2022-12-14 18:09:55 +03:00
|
|
|
|
|
|
|
it('should go to the details page', () => {
|
2023-01-30 21:09:45 +03:00
|
|
|
cy.visit(`/#/nfts/collection/${PUDGY_COLLECTION_ADDRESS}`)
|
2022-12-14 18:09:55 +03:00
|
|
|
cy.get(getTestSelector('nft-filter')).first().click()
|
|
|
|
cy.get(getTestSelector('nft-collection-filter-buy-now')).click()
|
2023-03-14 22:38:39 +03:00
|
|
|
cy.get(getTestSelector('nft-collection-asset')).first().click()
|
2022-12-14 18:09:55 +03:00
|
|
|
cy.get(getTestSelector('nft-details-traits')).should('exist')
|
|
|
|
cy.get(getTestSelector('nft-details-activity')).should('exist')
|
|
|
|
cy.get(getTestSelector('nft-details-description')).should('exist')
|
|
|
|
cy.get(getTestSelector('nft-details-asset-details')).should('exist')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should toggle buy now on details page', () => {
|
2023-01-30 21:09:45 +03:00
|
|
|
cy.visit(`#/nfts/asset/${BONSAI_COLLECTION_ADDRESS}/7580`)
|
2022-12-14 18:09:55 +03:00
|
|
|
cy.get(getTestSelector('nft-details-description-text')).should('exist')
|
|
|
|
cy.get(getTestSelector('nft-details-description')).click()
|
|
|
|
cy.get(getTestSelector('nft-details-description-text')).should('not.exist')
|
|
|
|
cy.get(getTestSelector('nft-details-toggle-bag')).eq(1).click()
|
|
|
|
cy.get(getTestSelector('nft-bag')).should('exist')
|
|
|
|
})
|
2023-03-23 02:45:39 +03:00
|
|
|
|
|
|
|
it('should navigate to the owned nfts page', () => {
|
|
|
|
cy.get(getTestSelector('web3-status-connected')).click()
|
|
|
|
cy.get(getTestSelector('nft-view-self-nfts')).click()
|
|
|
|
})
|
2023-03-30 01:08:30 +03:00
|
|
|
|
|
|
|
it('should close the sidebar when navigating to NFT details', () => {
|
|
|
|
cy.get(getTestSelector('web3-status-connected')).click()
|
|
|
|
cy.get(getTestSelector('mini-portfolio-nav-nfts')).click()
|
|
|
|
cy.get(getTestSelector('mini-portfolio-nft')).first().click()
|
|
|
|
cy.contains('Buy crypto').should('not.be.visible')
|
|
|
|
})
|
2022-12-13 19:43:02 +03:00
|
|
|
})
|