Skip to content

Commit

Permalink
Atualiza para webpack 5 e remove protractor
Browse files Browse the repository at this point in the history
Testes e2e estão desabilitados
  • Loading branch information
juliomelo committed Sep 5, 2023
1 parent 09b4ed1 commit a01f8ad
Show file tree
Hide file tree
Showing 10 changed files with 4,367 additions and 12,676 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
firefox: [ 'latest-esr', 'latest' ]
chrome-version: [ 'latest ']

steps:
- uses: actions/checkout@v2
Expand All @@ -29,8 +30,8 @@ jobs:
- name: jshint
run: npx grunt jshint
- name: unit tests
uses:
- browser-actions/setup-firefox@v1
- browser-actions/setup-chrome@v1
run: npx grunt karma:unit
- name: Download ChromeDriver
run: node node_modules/protractor/bin/webdriver-manager update --versions.chrome $(/usr/bin/chromium --version | awk '{print $2}')
- name: e2e
run: npx grunt e2e

40 changes: 3 additions & 37 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,8 @@
module.exports = function (grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);
var webpackConfig = require("./webpack.config.js");
var webDriverProxy = process.env.http_proxy ? ' --proxy ' + process.env.http_proxy : '';


grunt.initConfig({
exec: {
updateWebdriverManager: {
cwd: 'node_modules/protractor/node_modules',
cmd: 'npm i webdriver-manager@~12.1.0'
},
updateWebdriver: 'node node_modules/protractor/bin/webdriver-manager update' + webDriverProxy + ' --gecko=false'
},
karma: {
unit: {
configFile: 'karma.conf.js',
Expand All @@ -40,17 +32,6 @@ module.exports = function (grunt) {
singleRun: false
}
},
protractor: {
options: {
configFile: 'protractor-conf.js',
noColor: false
},
e2e: {
options: {
keepAlive: false
}
}
},
webpack: {
buildPlain: webpackConfig('plain-js'),
buildAngular1: webpackConfig('angular1'),
Expand All @@ -59,21 +40,8 @@ module.exports = function (grunt) {
"build-dev": webpackConfig('plain-js', true)
},
"webpack-dev-server": {
options: {
webpack: webpackConfig('plain-js', true),
contentBase: ['exemplo', 'test']
},
options: webpackConfig('plain-js', true),
start: {
webpack: {
devtool: "inline-source-map",
}
},
e2e: {
keepalive: false,
port: 8075,
webpack: {
devtool: "inline-source-map",
}
}
},
watch: {
Expand Down Expand Up @@ -109,9 +77,7 @@ module.exports = function (grunt) {
grunt.registerTask("build-plain-polyfill", ["webpack:buildPlainPolyfill"]);
grunt.registerTask("build-angular1", ["webpack:buildAngular1"]);

grunt.registerTask('e2e-updating', ['exec:updateWebdriverManager', 'exec:updateWebdriver', 'webpack-dev-server:e2e', 'protractor:e2e']);
grunt.registerTask('e2e', ['webpack-dev-server:e2e', 'protractor:e2e']);
grunt.registerTask('test', ['jshint', 'karma:unit', 'e2e-updating']);
grunt.registerTask('test', ['jshint', 'karma:unit']);

grunt.registerTask('debug', ['karma:debug']);
};
Loading

0 comments on commit a01f8ad

Please sign in to comment.