Initial commit

This commit is contained in:
Bart Onstee 2024-07-03 10:35:45 +02:00
commit c47604d4e3
10 changed files with 2287 additions and 0 deletions

166
.gitignore vendored Normal file
View file

@ -0,0 +1,166 @@
# Please take extra care not to add rules that will make tracked files ignored.
# To test that, run `git ls-files -i --exclude-standard`.
# To check why a specific file is ignored, run `git check-ignore -v <filepath>`.
# === Rule for dotfiles ===
# Ignore all dotfiles.
.*
# Exclude specific dotfiles that we want to track.
!deps/**/.*
!.devcontainer/
!.devcontainer/.devcontainer.json
!test/fixtures/**/.*
!.clang-format
!.cpplint
!.editorconfig
!.gitattributes
!.github
!.gitignore
!.gitkeep
!.gitpod.yml
!.mailmap
!.nycrc
!.yamllint.yaml
# === Rules for root dir ===
/core
/vgcore.*
/v8*.log
/perf.data
/perf.data.old
/tags
/tags.*
/doc/api.xml
/node
/node_g
/gon-config.json
/*.exe
/*.swp
/out
/*.msi
/*.wixpdb
/*.qlog
# For GitHub Codespaces
/pythonenv*
# === Rules for artifacts of `./configure` ===
/icu_config.gypi
/config.gypi
/config.status
/config_fips.gypi
# === Rules for MSVS artifacts ===
Debug/
Release/
*.sln
*.suo
*.vcxproj*
UpgradeLog*.XML
_UpgradeReport_Files/
*.sdf
*.opensdf
*.VC.*
*.wixobj
/tools/msvs/genfiles/
/npm.wxs
/corepack.wxs
/tools/msvs/msi/**/Release/
/tools/msvs/msi/**/obj/
/tools/msvs/msi/**/x64/
# Exclude MSVS files used for .msi file generation
!tools/msvs/msi/**/custom_actions.vcxproj
!tools/msvs/msi/**/nodemsi.sln
# === Rules for GYP artifacts ===
*-nodegyp*
/gyp-*-tool
/test/addons/??_*/
/*.mk
# === Rules for other build artifacts ===
/email.md
/deps/v8-*
/deps/icu
/deps/icu*.zip
/deps/icu*.tgz
/deps/icu-tmp
./node_modules
/android-toolchain/
# generated by gyp on Windows
/deps/openssl/openssl.props
/deps/openssl/openssl.targets
/deps/openssl/openssl.xml
/deps/openssl/openssl-fipsmodule.props
/deps/openssl/openssl-fipsmodule.targets
/deps/openssl/openssl-fipsmodule.xml
# generated by gyp on android
/*.target.mk
/*.host.mk
/deps/openssl/openssl.target.mk
/deps/zlib/zlib.target.mk
# generated by MSVC with /P enabled
tools/*/*.i
tools/*/*.i.tmp
# === Rules for release artifacts ===
/*.tar.*
/*.pkg
/SHASUMS*.txt*
# === Rules for `node_modules` ===
!**/node_modules/**
/node_modules
/tools/doc/node_modules
/tools/clang-format/node_modules
# === Rules for test artifacts ===
/*.tap
/*.xml
/v8*-tap.json
/node_trace.*.log
# coverage related
/gcovr
/build
/coverage
# === Rules for Xcode artifacts ===
*.xcodeproj
*.xcworkspace
*.pbxproj
# === Rules for files in `/deps` ===
# Exclude all files in the vendored `npm`.
!/deps/npm/node_modules
# These are not needed and causes issues for distro packagers.
/deps/npm/node_modules/.bin/
# Respect V8's .gitignore
!deps/v8/**
# Ignore the libuv book
/deps/uv/docs/code/
/deps/uv/docs/src/guide/
# Ignore .github directories
/deps/**/.github/
# Ignore dependencies fetched by tools/v8/fetch_deps.py
/deps/.cipd
# === Rules for Windows vcbuild.bat ===
/temp-vcbuild
# === Rules for CMake ===
cmake-build-debug/
CMakeCache.txt
CMakeFiles
CTestTestfile.cmake
cmake_install.cmake
install_manifest.txt
*.cbp
# === Global Rules ===
# Keep last to avoid being excluded
*.pyc
__pycache__
.DS_Store
*~
# === Rules for C++ development ===
compile_commands.json

10
cypress.config.js Normal file
View file

@ -0,0 +1,10 @@
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
baseUrl: 'http://localhost:8080'
},
testIsolation: false
},
});

View file

@ -0,0 +1,70 @@
import { Chance } from "../../plugins/chance";
describe('create user', () => {
Cypress.session.clearAllSavedSessions();
it('login', () => {
cy.login('bonstee@goudse.com', 'LuukWillem2019!');
cy.get('h3').should('contain', 'Selecteer uw rol');
});
it('funct. beh. rol', () => {
cy.get('h4').contains('Functioneel').click();
cy.window().then((win) => {
const role = win.mx.session.getUserRoleNames()[0];
expect(role).to.equal('nrDF7qsbZX');
});
});
it('bedrijven', () => {
cy.get('a').contains('Bedrijven').click();
cy.get('h1').should('contain', 'Bedrijven');
});
it('zoek Goudse', () => {
cy.get('.oe-input-organization').first('input').type('Goudse Schadeverzekeringen N.V.');
cy.get('.oe-input-city').first('input').type('Gouda');
cy.get('.oe-trigger-search-btn').click();
cy.get('.mx-listview').find('li').should('have.length', 1);
});
it('open Goudse', () => {
cy.get('.mx-listview').find('li').first().click();
cy.get('h3').should('contain', 'Goudse Schadeverzekeringen N.V.');
});
it('wizard', () => {
cy.get('button').contains('Toevoegen gebruiker').click();
cy.get('h1').should('contain', 'Toevoegen gebruiker');
const name = [Chance().first(), Chance().first(), Chance().last()];
const email = name[0] + '.' + name[1] + '.' + name[2] + '@test.com';
cy.get('.card').within(() => {
cy.get('.radio').first().click();
cy.get('.mx-textbox').eq(0).type(name[0]);
cy.get('.mx-textbox').eq(1).type(name[1]);
cy.get('.mx-textbox').eq(2).type(name[2]);
cy.get('.mx-dropdown').first().within(() => {
cy.get('select').select('Overig');
cy.get('select').should('have.value', 'Overig');
});
cy.get('button').contains('Volgende').click();
cy.get('h2').should('contain', 'E-mailadres gebruiker');
cy.get('.mx-textbox').first().type(email);
cy.get('button').contains('Volgende').click();
cy.get('button').contains('Volgende').click();
cy.get('button').contains('Afronden').click();
})
// cy.get('button').contains('Filteren').click();
// cy.get('.oe-input-city').first('input').type('Gouda');
// cy.get('.mx-textbox').eq(3).type(email);
// cy.get('.mx-link').contains('Zoeken').click();
// cy.get('.mx-listview').find('li').should('have.length', 1);
});
})

5
cypress/e2e/test.cy.js Normal file
View file

@ -0,0 +1,5 @@
describe('test', () => {
it('passes', () => {
cy.visit('https://example.cypress.io')
})
})

View file

@ -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"
}

View file

@ -0,0 +1,42 @@
// ***********************************************
// 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) => { ... })
Cypress.Commands.add('login', (username, password) => {
cy.session(
username,
() => {
cy.visit('http://localhost:8080/sfogerkclwzkstzgmvshokibmpvcfpgy.html')
cy.get('input[id=usernameInput]').type(username)
cy.get('input[id=passwordInput]').type(`${password}{enter}`, { log: false })
cy.url().should('include', '/index3.html')
},
{
validate: () => {
cy.getCookie('xasid').should('exist')
},
}
)
})

20
cypress/support/e2e.js Normal file
View file

@ -0,0 +1,20 @@
// ***********************************************************
// 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'
// Alternatively you can use CommonJS syntax:
// require('./commands')

1959
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

5
package.json Normal file
View file

@ -0,0 +1,5 @@
{
"devDependencies": {
"cypress": "^13.12.0"
}
}

5
plugins/chance.js Normal file

File diff suppressed because one or more lines are too long