diff --git a/.github/workflows/crypress.yml b/.github/workflows/crypress.yml index 32fbfb1..d12a5ae 100644 --- a/.github/workflows/crypress.yml +++ b/.github/workflows/crypress.yml @@ -1,45 +1,88 @@ -name: Cypress Tests with Install Job and UI Chrome Job x 5 +# name: Cypress Tests with Install Job and UI Chrome Job x 5 +# # https://docs.cypress.io/guides/continuous-integration/github-actions#Worker-Jobs +# on: [push] -on: [push] +# jobs: +# install: +# runs-on: ubuntu-latest +# container: cypress/browsers:node12.18.3-chrome87-ff82 +# steps: +# - name: Checkout +# uses: actions/checkout@v2 + + +# - name: Cypress install +# uses: cypress-io/github-action@v2 +# with: +# # Disable running of tests within install job +# runTests: false +# build: yarn build + +# - name: Save build folder +# uses: actions/upload-artifact@v2 +# with: +# name: dist +# if-no-files-found: error +# path: dist +# ui-chrome-tests: +# runs-on: ubuntu-latest +# container: cypress/browsers:node12.18.3-chrome87-ff82 +# needs: install +# strategy: +# fail-fast: false +# matrix: +# # run copies of the current job in parallel +# # containers: [1, 2, 3, 4, 5] +# containers: [1] +# steps: +# - name: Checkout +# uses: actions/checkout@v2 + +# - name: Download the build folders +# uses: actions/download-artifact@v2 +# with: +# name: dist +# path: dist + +# - name: 'UI Tests - Chrome' +# uses: cypress-io/github-action@v2 +# with: +# # we have already installed all dependencies above +# install: false +# start: yarn start:ci +# wait-on: 'http://localhost:3000' +# wait-on-timeout: 120 +# browser: chrome +# record: true +# parallel: true +# group: 'UI - Chrome' +# spec: cypress/tests/ui/* +# env: +# CYPRESS_RECORD_KEY: ${{ secrets.DASHBOARDRECORDKEY }} +# # Recommended: pass the GitHub token lets this action correctly +# # determine the unique run id necessary to re-run the checks +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + +name: Chrome headless + +on: push jobs: - install: - # ... - - ui-chrome-tests: - runs-on: ubuntu-latest - container: cypress/browsers:node12.18.3-chrome87-ff82 - needs: install - strategy: - fail-fast: false - matrix: - # run copies of the current job in parallel - containers: [1, 2, 3, 4, 5] + chrome-headless: + runs-on: ubuntu-18.04 steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Download the build folders - uses: actions/download-artifact@v2 - with: - name: build - path: build - - - name: 'UI Tests - Chrome' + uses: actions/checkout@v1 + - name: Headless Chrome uses: cypress-io/github-action@v2 + timeout-minutes: 10 with: - # we have already installed all dependencies above - install: false - start: yarn start:ci - wait-on: 'http://localhost:3000' - wait-on-timeout: 120 + build: npm run build + start: npm start browser: chrome + headless: true record: true - parallel: true - group: 'UI - Chrome' - spec: cypress/tests/ui/* env: - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - # Recommended: pass the GitHub token lets this action correctly - # determine the unique run id necessary to re-run the checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + # pass the Dashboard record key as an environment variable + CYPRESS_RECORD_KEY: ${{ secrets.dashboardRecordKey }} \ No newline at end of file diff --git a/README.md b/README.md index 078f96b..cce6b9f 100644 --- a/README.md +++ b/README.md @@ -21,29 +21,67 @@ To build the examples locally, run: ```bash yarn + yarn start ``` +### NOTE: as of 2024 node doenst support some things im using tofix that run +### if you get code: 'ERR_OSSL_EVP_UNSUPPORTED' error +`export NODE_OPTIONS=--openssl-legacy-provider` + +### Then open `http://localhost:3000` in a browser -### Then open `http://localhost:8886` in a browser +---------- +# how to debug regex generator grammer parser +``` +yarn global add nearley +nearleyc grammer.ne -o src/lib/grammer.js +nearley-railroad grammer.ne -o grammar.html +python -m http.server 80 +``` + +# NOTE ALL CYPRESS TESTS ARE CURRENTLY BORKED! broken :/ as of 20240718 ## Locally run integration tests with crypress ```bash +yarn start +``` +### in a new tab run +```bash yarn yarn run cypress:open ``` -### Run integration tests with crypress +### Run integration tests with crypress ```bash yarn yarn run cy:ci ``` +### open grammar.html in your browser to view railroad diagram of grammer +### http://localhost:80/grammar.html + +### Github actions how to setup DASHBOARDRECORDKEY +### [cypress setup api key](https://docs.cypress.io/guides/dashboard/projects#Set-up-a-project-to-record) + + + # [Actions secrets](https://github.com/wisehackermonkey/text-processor-react/settings/secrets/actions) +# [Actions secrets](https://github.com//settings/secrets/actions) + + +# https://dashboard.cypress.io/projects/ + + + # TODO add - ~~better css~~ DONE - ~~add localstorage~~ DONE +- add save file button + - add open file - add pastebin save with api key +- add cool colored text visualizer for the regex +- chatgpt plugin with buttons for helper # links [GitHub - react-monaco-editor/react-monaco-editor: Monaco Editor for React.](https://github.com/react-monaco-editor/react-monaco-editor) [Monaco Editor Playground](https://microsoft.github.io/monaco-editor/playground.html#creating-the-editor-editor-basic-options) diff --git a/assets/2021-10-29-17-59-05.png b/assets/2021-10-29-17-59-05.png new file mode 100644 index 0000000..d3f2651 Binary files /dev/null and b/assets/2021-10-29-17-59-05.png differ diff --git a/assets/2021-10-29-17-59-40.png b/assets/2021-10-29-17-59-40.png new file mode 100644 index 0000000..6335c40 Binary files /dev/null and b/assets/2021-10-29-17-59-40.png differ diff --git a/assets/2021-10-29-18-00-50.png b/assets/2021-10-29-18-00-50.png new file mode 100644 index 0000000..841c91f Binary files /dev/null and b/assets/2021-10-29-18-00-50.png differ diff --git a/cypress.json b/cypress.json index f543708..0bd7287 100644 --- a/cypress.json +++ b/cypress.json @@ -1,4 +1,3 @@ { - "projectId": "wu2ucs", - "baseUrl": "http://localhost:3000" -} \ No newline at end of file + "projectId": "wu2ucs" + } \ No newline at end of file diff --git a/cypress/integration/1-getting-started/todo.spec.js b/cypress/integration/1-getting-started/todo.spec.js deleted file mode 100644 index 4768ff9..0000000 --- a/cypress/integration/1-getting-started/todo.spec.js +++ /dev/null @@ -1,143 +0,0 @@ -/// - -// Welcome to Cypress! -// -// This spec file contains a variety of sample tests -// for a todo list app that are designed to demonstrate -// the power of writing tests in Cypress. -// -// To learn more about how Cypress works and -// what makes it such an awesome testing tool, -// please read our getting started guide: -// https://on.cypress.io/introduction-to-cypress - -describe('example to-do app', () => { - beforeEach(() => { - // Cypress starts out with a blank slate for each test - // so we must tell it to visit our website with the `cy.visit()` command. - // Since we want to visit the same URL at the start of all our tests, - // we include it in our beforeEach function so that it runs before each test - cy.visit('https://example.cypress.io/todo') - }) - - it('displays two todo items by default', () => { - // We use the `cy.get()` command to get all elements that match the selector. - // Then, we use `should` to assert that there are two matched items, - // which are the two default items. - cy.get('.todo-list li').should('have.length', 2) - - // We can go even further and check that the default todos each contain - // the correct text. We use the `first` and `last` functions - // to get just the first and last matched elements individually, - // and then perform an assertion with `should`. - cy.get('.todo-list li').first().should('have.text', 'Pay electric bill') - cy.get('.todo-list li').last().should('have.text', 'Walk the dog') - }) - - it('can add new todo items', () => { - // We'll store our item text in a variable so we can reuse it - const newItem = 'Feed the cat' - - // Let's get the input element and use the `type` command to - // input our new list item. After typing the content of our item, - // we need to type the enter key as well in order to submit the input. - // This input has a data-test attribute so we'll use that to select the - // element in accordance with best practices: - // https://on.cypress.io/selecting-elements - cy.get('[data-test=new-todo]').type(`${newItem}{enter}`) - - // Now that we've typed our new item, let's check that it actually was added to the list. - // Since it's the newest item, it should exist as the last element in the list. - // In addition, with the two default items, we should have a total of 3 elements in the list. - // Since assertions yield the element that was asserted on, - // we can chain both of these assertions together into a single statement. - cy.get('.todo-list li') - .should('have.length', 3) - .last() - .should('have.text', newItem) - }) - - it('can check off an item as completed', () => { - // In addition to using the `get` command to get an element by selector, - // we can also use the `contains` command to get an element by its contents. - // However, this will yield the