isomorfeus-puppetmaster 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -17
- data/lib/isomorfeus/puppetmaster/driver/puppeteer.rb +30 -18
- data/lib/isomorfeus/puppetmaster/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a4b1855e0c0b1039666aa3ae0c5b1e1a8b2bb0c8b424dc7bc81bcd446fa88e4
|
4
|
+
data.tar.gz: e932a68c21221b7b526496c3e16f7d1eec0f4342ad625228771de054e944d88e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725d868d6bffc3c3ee9e8e105c26804b96b34db21dab68373e72f5c2f22ca2ea59f7a3d013484fcaf7cc388bd4e5d67f9621c102ac2737e290365aca06e0d948
|
7
|
+
data.tar.gz: 89fdfe7e7605221e593056db787d0a2ae01d57c607ac0e4d1d3a3151334ba7bf8e6a2240f631a86bc6d321e8926ddefe1f8dee0bc2894ae9a46a1a15ba001983
|
data/README.md
CHANGED
@@ -1,28 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<h1 align="center">
|
2
|
+
<img src="https://github.com/isomorfeus/isomorfeus-puppetmaster/blob/master/Logo.png?raw=true" align="center" width="234" height="453" />
|
3
|
+
<br/>
|
4
|
+
Isomorfeus Puppetmaster<br/>
|
5
|
+
</h1>
|
6
|
+
A framework for acceptance tests or simply running tests in a headless browser.
|
7
|
+
Comes with drivers for chromium headless.
|
5
8
|
Allows for writing javascript browser tests in pure ruby.
|
6
9
|
|
7
10
|
### Community and Support
|
8
11
|
At the [Isomorfeus Framework Project](http://isomorfeus.com)
|
9
12
|
|
10
|
-
## Running on:
|
11
|
-
- [CircleCI](https://circleci.com): [![CircleCI](https://circleci.com/gh/isomorfeus/isomorfeus-puppetmaster/tree/master.svg?style=svg)](https://circleci.com/gh/isomorfeus/isomorfeus-puppetmaster/tree/master)
|
12
|
-
- [SemaphoreCI 2.0](https://semaphoreci.com): (not yet available)
|
13
|
-
- [TravisCI](https://travis-ci.org): [![Build Status](https://travis-ci.org/isomorfeus/isomorfeus-puppetmaster.svg?branch=master)](https://travis-ci.org/isomorfeus/isomorfeus-puppetmaster)
|
14
|
-
|
15
13
|
## Installation
|
16
14
|
|
17
15
|
In Gemfile:
|
18
16
|
`gem 'isomorfeus-puppetmaster'`, then `bundle install`
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
- [puppeteer 10.2.x](https://github.com/GoogleChrome/puppeteer#readme) - for the chrome driver
|
18
|
+
Comes included with:
|
23
19
|
|
24
|
-
|
25
|
-
Speednode will pickup the node modules then from the projects root node_modules directory.
|
20
|
+
- [puppeteer-core](https://github.com/GoogleChrome/puppeteer#readme) - for the chromium driver
|
26
21
|
|
27
22
|
## Configuration
|
28
23
|
|
@@ -63,13 +58,13 @@ There are Browsers which may have windows or tabs, which translate to targets or
|
|
63
58
|
In Puppetmaster, which is focusing on headless testing, the main "thing" is **just a document**. Its possible to open many documents at once, but what exactly a document is contained in,
|
64
59
|
a window or tab or browser or target or whatever, is not of interest.
|
65
60
|
A document consists of nodes. Simply working with just documents and nodes makes testing a lot simpler.
|
66
|
-
```
|
61
|
+
```
|
67
62
|
document
|
68
63
|
|____head (is a node)
|
69
64
|
| |
|
70
65
|
| |___more nodes
|
71
66
|
| |___...
|
72
|
-
|
|
67
|
+
|
|
73
68
|
|____body (is a node)
|
74
69
|
|
|
75
70
|
|___more nodes
|
@@ -132,7 +127,7 @@ TODO
|
|
132
127
|
#### DOM changes by Javascript, Timing
|
133
128
|
|
134
129
|
TODO
|
135
|
-
|
130
|
+
|
136
131
|
## Nodes
|
137
132
|
|
138
133
|
### Finding Nodes ...
|
@@ -253,7 +253,17 @@ module Isomorfeus
|
|
253
253
|
string_options = []
|
254
254
|
options = @options.dup
|
255
255
|
string_options << "ignoreHTTPSErrors: #{options.delete(:ignore_https_errors)}" if options.key?(:ignore_https_errors)
|
256
|
-
|
256
|
+
if Gem::Platform.local.os == 'linux' && Gem::Platform.local.cpu.start_with?('arm')
|
257
|
+
chromium_path = if options.key?(:executable_path)
|
258
|
+
options.delete(:executable_path)
|
259
|
+
else
|
260
|
+
Isomorfeus::Speednode::NodeCommand.which(['chromium'])
|
261
|
+
end
|
262
|
+
raise "Chromium not found. Please install chromium manually." unless chromium_path
|
263
|
+
string_options << "executablePath: '#{chromium_path}'"
|
264
|
+
else
|
265
|
+
string_options << "executablePath: '#{options.delete(:executable_path)}'" if options.key?(:executable_path)
|
266
|
+
end
|
257
267
|
options.each do |option, value|
|
258
268
|
string_options << "#{option.to_s.camelize(:lower)}: #{value}"
|
259
269
|
end
|
@@ -283,16 +293,16 @@ module Isomorfeus
|
|
283
293
|
var LastErr = null;
|
284
294
|
var LastExecutionFinished = false;
|
285
295
|
var LastHandleId = 0;
|
286
|
-
|
296
|
+
|
287
297
|
var AllPageHandles = {};
|
288
298
|
var AllElementHandles = {};
|
289
|
-
|
299
|
+
|
290
300
|
var CurrentBrowser = null;
|
291
301
|
var ConsoleMessages = {};
|
292
|
-
|
302
|
+
|
293
303
|
var ModalText = null;
|
294
304
|
var ModalTextMatched = false;
|
295
|
-
|
305
|
+
|
296
306
|
const EnsureBrowser = async function() {
|
297
307
|
var revisions = await BrowserFetcher.localRevisions();
|
298
308
|
if (!revisions.includes(default_revision)) {
|
@@ -306,48 +316,48 @@ module Isomorfeus
|
|
306
316
|
if (LastExecutionFinished === true) {
|
307
317
|
var err = LastErr;
|
308
318
|
var res = LastResult;
|
309
|
-
|
319
|
+
|
310
320
|
LastErr = null;
|
311
321
|
LastRes = null;
|
312
322
|
LastExecutionFinished = false;
|
313
|
-
|
323
|
+
|
314
324
|
if (err) { return [null, {name: err.name, message: err.message, stack: err.stack}]; }
|
315
325
|
else { return [res, null]; }
|
316
|
-
|
326
|
+
|
317
327
|
} else {
|
318
328
|
var new_err = new Error('Last command did not yet finish execution!');
|
319
329
|
return [null, {name: new_err.name, message: new_err.message, stack: new_err.stack}];
|
320
330
|
}
|
321
331
|
};
|
322
|
-
|
332
|
+
|
323
333
|
const DialogAcceptHandler = async (dialog) => {
|
324
334
|
var msg = dialog.message()
|
325
335
|
ModalTextMatched = (ModalText === msg);
|
326
336
|
ModalText = msg;
|
327
337
|
await dialog.accept();
|
328
338
|
}
|
329
|
-
|
339
|
+
|
330
340
|
const DialogDismissHandler = async (dialog) => {
|
331
341
|
var msg = dialog.message()
|
332
342
|
ModalTextMatched = (ModalText === msg);
|
333
343
|
ModalText = msg;
|
334
344
|
await dialog.dismiss();
|
335
345
|
}
|
336
|
-
|
346
|
+
|
337
347
|
const RegisterElementHandle = function(element_handle) {
|
338
348
|
var entries = Object.entries(AllElementHandles);
|
339
|
-
for(var i = 0; i < entries.length; i++) {
|
349
|
+
for(var i = 0; i < entries.length; i++) {
|
340
350
|
if (entries[i][1] === element_handle) { return entries[i][0]; }
|
341
351
|
}
|
342
352
|
LastHandleId++;
|
343
353
|
var handle_id = LastHandleId;
|
344
354
|
AllElementHandles[handle_id] = element_handle;
|
345
|
-
return handle_id;
|
355
|
+
return handle_id;
|
346
356
|
};
|
347
|
-
|
357
|
+
|
348
358
|
const RegisterPage = function(page) {
|
349
359
|
var entries = Object.entries(AllPageHandles);
|
350
|
-
for(var i = 0; i < entries.length; i++) {
|
360
|
+
for(var i = 0; i < entries.length; i++) {
|
351
361
|
if (entries[i][1] === page) { return entries[i][0]; }
|
352
362
|
}
|
353
363
|
LastHandleId++;
|
@@ -360,12 +370,14 @@ module Isomorfeus
|
|
360
370
|
AllPageHandles[handle_id].on('pageerror', (error) => {
|
361
371
|
ConsoleMessages[handle_id].push({level: 'error', location: '', text: error.message});
|
362
372
|
});
|
363
|
-
return handle_id;
|
373
|
+
return handle_id;
|
364
374
|
};
|
365
|
-
|
375
|
+
|
366
376
|
(async () => {
|
367
377
|
try {
|
368
|
-
|
378
|
+
if (process.arch !== 'arm') {
|
379
|
+
await EnsureBrowser();
|
380
|
+
}
|
369
381
|
CurrentBrowser = #{launch_line}
|
370
382
|
var page = (await CurrentBrowser.pages())[0];
|
371
383
|
page.setDefaultTimeout(#{@puppeteer_timeout});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-puppetmaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.4.
|
33
|
+
version: 0.4.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.4.
|
40
|
+
version: 0.4.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: method_source
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: opal
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.3.
|
75
|
+
version: 1.3.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.3.
|
82
|
+
version: 1.3.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: parser
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,14 +282,14 @@ dependencies:
|
|
282
282
|
requirements:
|
283
283
|
- - "~>"
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version: 3.
|
285
|
+
version: 3.50.0
|
286
286
|
type: :development
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
290
|
- - "~>"
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version: 3.
|
292
|
+
version: 3.50.0
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: tilt
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|