Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ This will create a copy of this repository, where you can then change:
* The `groupId`, `artifactId`, `name` and `description` fields in `pom.xml`
* Edit this `README.md` file to describe your extension to potential users and contributors instead of the sample extension's own instructions

### Building your extension
The sample extension uses the [maven-assembly-plugin](https://maven.apache.org/plugins/maven-assembly-plugin/) to support packaging the code as a zip file. Running `mvn package` will build a zip file which by default is placed in `target/<extension.id>-<version>.zip`. `extension.id` and `version` are defined in the extension's POM.
13 changes: 13 additions & 0 deletions cypress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
.idea
*.log
tmp/

*.tern-port
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.tsbuildinfo
.npm
.eslintcache
5 changes: 5 additions & 0 deletions cypress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# cypress end-to-end tests

End-to-end test scaffolding using [Cypress](https://docs.cypress.io/app/get-started/why-cypress#End-to-end-Testing). Install with npm via `npm install` and run via `npx cypress open --env OPENREFINE_URL=http://localhost:3333`.

More information about Cypress tests can be found in the [OpenRefine contributor documentation](https://openrefine.org/docs/technical-reference/writing-extensions#end-to-end-testing-in-cypress).
9 changes: 9 additions & 0 deletions cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
9 changes: 9 additions & 0 deletions cypress/cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
describe(__filename, () => {
it('Ensures the sample extension is installed in the OpenRefine instance', () => {
// Visit the extension management page and verify that our application is listed
cy.visit(Cypress.env('OPENREFINE_URL') + '/#manage-extensions')
cy.get('#extensionList td:first-child')
.filter(':contains("openrefine-sample-extension")')
.should('have.length', 1);
})
})
5 changes: 5 additions & 0 deletions cypress/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions cypress/cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
Loading