1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

consume integration test tweaks

This commit is contained in:
Matthias Kretschmann 2019-10-29 16:14:07 +01:00
parent aec1f78257
commit e417c8299a
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 30 additions and 82 deletions

View File

@ -25298,33 +25298,6 @@
"glob": "^7.1.2"
}
},
"truffle-hdwallet-provider": {
"version": "1.0.17",
"resolved": "https://registry.npmjs.org/truffle-hdwallet-provider/-/truffle-hdwallet-provider-1.0.17.tgz",
"integrity": "sha512-s6DvSP83jiIAc6TUcpr7Uqnja1+sLGJ8og3X7n41vfyC4OCaKmBtXL5HOHf+SsU3iblOvnbFDgmN6Y1VBL/fsg==",
"requires": {
"any-promise": "^1.3.0",
"bindings": "^1.3.1",
"web3": "1.2.1",
"websocket": "^1.0.28"
},
"dependencies": {
"web3": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/web3/-/web3-1.2.1.tgz",
"integrity": "sha512-nNMzeCK0agb5i/oTWNdQ1aGtwYfXzHottFP2Dz0oGIzavPMGSKyVlr8ibVb1yK5sJBjrWVnTdGaOC2zKDFuFRw==",
"requires": {
"web3-bzz": "1.2.1",
"web3-core": "1.2.1",
"web3-eth": "1.2.1",
"web3-eth-personal": "1.2.1",
"web3-net": "1.2.1",
"web3-shh": "1.2.1",
"web3-utils": "1.2.1"
}
}
}
},
"truncate-utf8-bytes": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz",
@ -27171,24 +27144,6 @@
"version": "github:ipfs/webrtcsupport#0669f576582c53a3a42aa5ac014fcc5966809615",
"from": "github:ipfs/webrtcsupport"
},
"websocket": {
"version": "1.0.30",
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.30.tgz",
"integrity": "sha512-aO6klgaTdSMkhfl5VVJzD5fm+Srhh5jLYbS15+OiI1sN6h/RU/XW6WN9J1uVIpUKNmsTvT3Hs35XAFjn9NMfOw==",
"requires": {
"debug": "^2.2.0",
"nan": "^2.14.0",
"typedarray-to-buffer": "^3.1.5",
"yaeti": "^0.0.6"
},
"dependencies": {
"nan": {
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg=="
}
}
},
"websocket-driver": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz",

View File

@ -45,7 +45,6 @@
"react-router-dom": "^5.1.2",
"react-transition-group": "^4.3.0",
"shortid": "^2.2.15",
"truffle-hdwallet-provider": "^1.0.17",
"web3": "^1.2.2"
},
"devDependencies": {

View File

@ -71,7 +71,9 @@ describe('Files', () => {
// open
fireEvent.click(getByText('+ Add to IPFS'))
const text = await waitForElement(() => getByText(/Connected to /))
const text = await waitForElement(() =>
getByText(/Connected to / || /IPFS connection error/)
)
expect(text).toBeInTheDocument()
// close

View File

@ -4,16 +4,16 @@ import '@testing-library/jest-dom/extend-expect'
// this is just a little hack to silence a warning that we'll get until we
// upgrade to 16.9: https://github.com/facebook/react/pull/14853
const originalError = console.error
// const originalError = console.error
const originalWarning = console.warn
beforeAll(() => {
console.error = (...args) => {
if (/Warning.*not wrapped in act/.test(args[0])) {
return
}
originalError.call(console, ...args)
}
// console.error = (...args) => {
// if (/Warning.*not wrapped in act/.test(args[0])) {
// return
// }
// originalError.call(console, ...args)
// }
console.warn = (...args) => {
if (/Warning.*componentWillMount has been renamed/.test(args[0])) {
@ -24,6 +24,6 @@ beforeAll(() => {
})
afterAll(() => {
console.error = originalError
// console.error = originalError
console.warn = originalWarning
})

View File

@ -1,38 +1,31 @@
/// <reference types="Cypress" />
describe('Consume', () => {
beforeEach(() => {
it('should consume https:// file', () => {
cy.fixture('did').then(did => {
cy.visit(`/asset/${did}`)
})
// Alias button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 })
.first()
.should('have.length', 1)
})
// Button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 }).should(
'not.be.disabled'
)
it('Download button is clickable when user is connected.', () => {
cy.get('button[name="Download"]').should('not.be.disabled')
})
it('should consume https:// file', () => {
// eslint-disable-next-line
cy.wait(10000)
cy.wait(5000)
// Wait for faucet
// Click consume button
cy.get('button[name="Download"]').click()
// Wait consume process to end
cy.get('button[name="Download"]', { timeout: 600000 }).should(
'contain',
'Get file'
)
cy.get('button[name="Download"]', {
timeout: 600000
}).should('contain', 'Get file')
// check if there is no error
cy.get('article>div').should(
'not.contain',
'. Sorry about that, can you try again?'
)
// eslint-disable-next-line
cy.wait(10000)
cy.wait(5000)
// wait for file to download before closing browser
// to prevent alert poping up
})
@ -42,28 +35,27 @@ describe('Consume', () => {
cy.visit(`/asset/${did}`)
})
// Alias button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 })
.first()
.should('have.length', 1)
// Button selector & wait for end of loading
cy.get('button[name="Download"]', { timeout: 60000 }).should(
'not.be.disabled'
)
// eslint-disable-next-line
cy.wait(10000)
cy.wait(5000)
// Wait for faucet
// Click consume button
cy.get('button[name="Download"]').click()
// Wait consume process to end
cy.get('button[name="Download"]', { timeout: 600000 }).should(
'contain',
'Get file'
)
cy.get('button[name="Download"]', {
timeout: 600000
}).should('contain', 'Get file')
// check if there is no error
cy.get('article>div').should(
'not.contain',
'. Sorry about that, can you try again?'
)
// eslint-disable-next-line
cy.wait(10000)
cy.wait(5000)
// wait for file to download before closing browser
// to prevent alert poping up
})