Skip to content
Merged
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
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [openrefine]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://donorbox.org/open-refine']
27 changes: 0 additions & 27 deletions .github/workflows/ci.yaml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Restore dependency cache
uses: actions/cache@v4
with:
path: |
cypress/openrefine-*.tar.gz
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Build with Maven
run: mvn -B package

- name: Install Cypress
run: |
cd ./cypress
npm i -g yarn
yarn install

- name: Run Cypress tests
run: ./cypress/run_headless.sh

- name: Get release upload URL
id: get_release_upload_url
if: github.event_name == 'release'
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload release asset
id: upload-release-asset
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1.7.5
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./target/openrefine-files-extension-${{ env.VERSION_STRING }}.zip
asset_name: openrefine-files-extension-${{ env.VERSION_STRING }}.zip
asset_content_type: application/zip

4 changes: 4 additions & 0 deletions cypress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.yarn/
.yarnrc.yml
openrefine*
9 changes: 9 additions & 0 deletions cypress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Files extension E2E tests

Inspired from [OpenRefine's own Cypress test suite](https://openrefine.org/docs/technical-reference/functional-tests)

Install the dependencies with `yarn install`.

Run the test suite with `yarn run cypress open`.

This requires a running instance of OpenRefine with the FilesExtension installed at `http://localhost:3333/`.
24 changes: 24 additions & 0 deletions cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
keystrokeDelay: 0,
viewportWidth: 1280,
viewportHeight: 768,
retries: {
runMode: 3,
openMode: 0,
},
env: {
OPENREFINE_URL: 'http://localhost:3333',
DISABLE_PROJECT_CLEANUP: 0,
},
e2e: {
experimentalRunAllSpecs: true,
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
specPattern: './cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
},
})
44 changes: 44 additions & 0 deletions cypress/cypress/e2e/import_file_details/create_project.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
describe(__filename, function () {
afterEach(() => {
cy.addProjectForDeletion();
});

it('Test the create project using Files Extension', function () {
cy.visitOpenRefine();
cy.navigateTo('Create project');
cy.get('#create-project-ui-source-selection-tabs > a')
.contains('Files from local directory')
.click();
// enter a category name
cy.get('#drive-selector'
).select('/home');


// Wait for the directory tree container to become visible
cy.get('#directory-tree-container', { timeout: 10000 }) // Adjust timeout as needed
.should('be.visible'); // Ensures the element is visible

// Interact with the "Home" option in the tree
cy.get('#directory-tree').contains('home').click(); // Replace 'Home' with exact text if needed


cy.get(
'.create-project-ui-source-selection-tab-body.selected button.button-primary'
)
.contains('Next')
.click();

// then ensure we are on the preview page
cy.get('.create-project-ui-panel').contains('Project name');

// preview and click next
cy.get('button[bind="createProjectButton"]')
.contains('Create Project »')
.click();
cy.waitForProjectTable();

cy.get('button[id="project-name-button"]')
.should('have.text', 'folder-details_home');

});
});
5 changes: 5 additions & 0 deletions cypress/cypress/fixtures/fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

const fixtures = {
};

export default fixtures;
22 changes: 22 additions & 0 deletions cypress/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// / <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
/**
* @type {Cypress.PluginConfig}
*/

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
return config;
};
Loading