2019-06-19 15:28:31 +02:00
|
|
|
/// <reference types="Cypress" />
|
2019-09-18 15:54:50 +02:00
|
|
|
describe('Publish', () => {
|
|
|
|
beforeEach(() => {
|
2019-06-26 11:13:41 +02:00
|
|
|
cy.visit('/publish')
|
2019-06-19 15:28:31 +02:00
|
|
|
|
2019-06-20 13:41:11 +02:00
|
|
|
cy.get('article>div', { timeout: 60000 }).should(
|
2019-06-19 15:28:31 +02:00
|
|
|
'contain',
|
|
|
|
'Essentials'
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
2019-09-18 15:54:50 +02:00
|
|
|
it('should publish https:// file', () => {
|
2019-06-19 15:28:31 +02:00
|
|
|
// Fill title
|
2019-07-08 16:29:21 +02:00
|
|
|
cy.get('input#name').type('Commons Integration Test')
|
2019-06-19 15:28:31 +02:00
|
|
|
// Open Add a file form
|
|
|
|
cy.get('button')
|
2019-09-05 12:34:11 +02:00
|
|
|
.contains('+ From URL')
|
2019-06-19 15:28:31 +02:00
|
|
|
.click()
|
|
|
|
// Fill url of file
|
|
|
|
cy.get('input#url').type(
|
|
|
|
'https://oceanprotocol.com/tech-whitepaper.pdf'
|
|
|
|
)
|
|
|
|
// Add file to main form
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Add File')
|
|
|
|
.click()
|
|
|
|
// Verify and nove to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Information')
|
|
|
|
// Fill description
|
|
|
|
cy.get('textarea#description').type('This is test description')
|
|
|
|
// Pick category
|
|
|
|
cy.get('select#categories').select('Biology')
|
|
|
|
// Verify and move to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Authorship')
|
|
|
|
// Fill author
|
|
|
|
cy.get('input#author').type('Super Author')
|
|
|
|
// Fill copyright holder
|
|
|
|
cy.get('input#copyrightHolder').type('Super Copyright Holder')
|
|
|
|
// Pick author
|
|
|
|
cy.get('select#license').select('Public Domain')
|
|
|
|
// Verify and move to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Register')
|
|
|
|
// Start publish process
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Register asset')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Wait for finish
|
|
|
|
cy.contains('Your asset is published!', {
|
2019-06-20 13:41:11 +02:00
|
|
|
timeout: 12000
|
2019-06-19 15:28:31 +02:00
|
|
|
}).should('be.visible')
|
2019-07-19 16:38:29 +02:00
|
|
|
|
|
|
|
// Store DID
|
|
|
|
cy.get('a')
|
|
|
|
.contains('See published asset')
|
|
|
|
.invoke('attr', 'href')
|
|
|
|
.then(href => {
|
|
|
|
cy.writeFile(
|
|
|
|
'cypress/fixtures/did.txt',
|
|
|
|
href.replace('/asset/', '')
|
|
|
|
)
|
|
|
|
})
|
2019-06-19 15:28:31 +02:00
|
|
|
})
|
2019-09-18 15:54:50 +02:00
|
|
|
|
|
|
|
it('should publish ipfs:// file', () => {
|
|
|
|
// Fill title
|
|
|
|
cy.get('input#name').type('Commons Integration IPFS Test')
|
|
|
|
// Open Add a file form
|
|
|
|
cy.get('button')
|
|
|
|
.contains('+ From URL')
|
|
|
|
.click()
|
|
|
|
// Fill url of file
|
|
|
|
cy.get('input#url').type(
|
|
|
|
'ipfs://QmX5LRpEVocfks9FNDnRoK2imf2fy9mPpP4wfgaDVXWfYD/video.mp4'
|
|
|
|
)
|
|
|
|
// Add file to main form
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Add File')
|
|
|
|
.click()
|
|
|
|
// Verify and nove to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Information')
|
|
|
|
// Fill description
|
|
|
|
cy.get('textarea#description').type('This is test description')
|
|
|
|
// Pick category
|
|
|
|
cy.get('select#categories').select('Biology')
|
|
|
|
// Verify and move to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Authorship')
|
|
|
|
// Fill author
|
|
|
|
cy.get('input#author').type('Super Author')
|
|
|
|
// Fill copyright holder
|
|
|
|
cy.get('input#copyrightHolder').type('Super Copyright Holder')
|
|
|
|
// Pick author
|
|
|
|
cy.get('select#license').select('Public Domain')
|
|
|
|
// Verify and move to next step
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Next →')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Verify we are on next step
|
|
|
|
cy.get('article>div').should('contain', 'Register')
|
|
|
|
// Start publish process
|
|
|
|
cy.get('button')
|
|
|
|
.contains('Register asset')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click()
|
|
|
|
// Wait for finish
|
|
|
|
cy.contains('Your asset is published!', {
|
|
|
|
timeout: 12000
|
|
|
|
}).should('be.visible')
|
|
|
|
|
|
|
|
// Store DID
|
|
|
|
cy.get('a')
|
|
|
|
.contains('See published asset')
|
|
|
|
.invoke('attr', 'href')
|
|
|
|
.then(href => {
|
|
|
|
cy.writeFile(
|
|
|
|
'cypress/fixtures/did-ipfs.txt',
|
|
|
|
href.replace('/asset/', '')
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|
2019-06-19 15:28:31 +02:00
|
|
|
})
|