diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5f19d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..380eba9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: node_js +node_js: + - 10 +addons: + apt: + packages: + - libgconf-2-4 +cache: + npm: true + directories: + - ~/.cache +install: + - npm install cypress + - $(npm bin)/cypress install +script: + - $(npm bin)/cypress run diff --git a/cypress.json b/cypress.json new file mode 100644 index 0000000..aaab74e --- /dev/null +++ b/cypress.json @@ -0,0 +1,6 @@ +{ + "fixturesFolder": false, + "pluginsFile": false, + "supportFile": false, + "video": false +} diff --git a/cypress/integration/basics.js b/cypress/integration/basics.js new file mode 100644 index 0000000..fdee230 --- /dev/null +++ b/cypress/integration/basics.js @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2020 The Software Heritage developers + * See the AUTHORS file at the top-level directory of this distribution + * License: GNU Affero General Public License version 3, or any later version + * See top-level LICENSE file for more information + */ + +/* + * Tests the basic features of the application. + */ + +"use strict"; + +describe('JSON Generation', function() { + it('works just from the software name', function() { + cy.visit('./index.html'); + cy.get('#name').type('My Test Software'); + cy.get('#generateCodemeta').click(); + + cy.get('#codemetaText').then((elem) => JSON.parse(elem.text())) + .should('deep.equal', { + "@context": "https://doi.org/10.5063/schema/codemeta-2.0", + "@type": "SoftwareSourceCode", + "license": "https://spdx.org/licenses/undefined", + "name": "My Test Software", + "author": [], + "contributor": [] + }) + }) +})