Skip to content

Commit

Permalink
Migra testes do karma para playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
juliomelo committed Feb 20, 2024
1 parent 60e295c commit a2dd69f
Show file tree
Hide file tree
Showing 47 changed files with 1,298 additions and 3,201 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ on:

jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Instalar dependências
run: npm ci
- name: eslint
run: npx lint
# - name: unit tests
# run: npx grunt karma:unit
- name: Instalar navegadores do Playwright
run: npx playwright install --with-deps
- name: Executar testes do Playwright
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30


6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
/coverage
/node_modules
debug.log
/dist
/dist
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
30 changes: 30 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "silegismg-editor-articulacao",
"description": "Biblioteca javasciprt de edição da articulação de uma norma ou projeto de lei, conforme formato especificado pelo LexML.",
"main": "src/editor-articulacao.js",
"authors": [
"Assembleia Legislativa de Minas Gerais (ALMG)"
],
"license": "LGPL",
"keywords": [
"silegismg",
"lexml",
"articulacao",
"editor",
"almg",
"assembleia",
"camara",
"senado",
"legislativa",
"legislativo",
"lexedit"
],
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
6 changes: 3 additions & 3 deletions empacotamento/plain-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import * as interpretadorArticulacao from '../src/interpretadorArticulacao';
*
* @param {Element} elemento
*/
function criarControllerEditorArticulacao(elemento, opcoes) {
export function criarControllerEditorArticulacao(elemento, opcoes) {
elemento.ctrlArticulacao = new EditorArticulacaoController(elemento, opcoes);

Object.defineProperty(elemento, 'lexml', {
Expand All @@ -44,7 +44,7 @@ function criarControllerEditorArticulacao(elemento, opcoes) {
return elemento.ctrlArticulacao;
}

function prepararEditorArticulacaoCompleto(elemento, opcoes) {
export function prepararEditorArticulacaoCompleto(elemento, opcoes) {
elemento.componenteEdicao = new ComponenteEdicao(elemento, opcoes);

Object.defineProperty(elemento, 'lexml', {
Expand All @@ -61,4 +61,4 @@ function prepararEditorArticulacaoCompleto(elemento, opcoes) {

window.silegismgEditorArticulacao = prepararEditorArticulacaoCompleto;
window.silegismgEditorArticulacaoController = criarControllerEditorArticulacao;
window.silegismgInterpretadorArticulacao = interpretadorArticulacao;
window.silegismgInterpretadorArticulacao = interpretadorArticulacao;
20 changes: 9 additions & 11 deletions empacotamento/karma.js → empacotamento/playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@
* You should have received a copy of the GNU Lesser General Public License
* along with Editor-Articulacao. If not, see <http://www.gnu.org/licenses/>.
*/

import importarDeLexML from '../src/lexml/importarDeLexML';
import exportarParaLexML from '../src/lexml/exportarParaLexML';
import interpretadorArticulacao from '../src/interpretadorArticulacao';
import { transformarTextoPuro, transformar } from '../src/ClipboardController';
import { prepararEditorArticulacaoCompleto, criarControllerEditorArticulacao } from './plain-js';
import * as interpretadorArticulacao from '../src/interpretadorArticulacao';
import { transformar } from '../src/ClipboardController';
import ValidacaoController from '../src/validacao/ValidacaoController';

window.importarDeLexML = importarDeLexML;
window.exportarParaLexML = exportarParaLexML;
window.interpretadorArticulacao = interpretadorArticulacao;
window.clipboardControllerModule = {
interpretarTextoPuro: transformarTextoPuro,
transformar: transformar
transformar
};
window.ValidacaoController = ValidacaoController;
window.ValidacaoController = ValidacaoController;

window.silegismgEditorArticulacao = prepararEditorArticulacaoCompleto;
window.silegismgEditorArticulacaoController = criarControllerEditorArticulacao;
window.silegismgInterpretadorArticulacao = interpretadorArticulacao;
Loading

0 comments on commit a2dd69f

Please sign in to comment.