File tree 3 files changed +69
-6
lines changed
examples/browser-load-testing-playwright
lib/platform/aws-ecs/legacy
3 files changed +69
-6
lines changed Original file line number Diff line number Diff line change 1
- import { checkOutArtilleryCoreConceptsFlow } from './flows.js' ;
2
-
3
1
export const config = {
4
2
target : 'https://www.artillery.io' ,
5
3
phases : [
@@ -9,7 +7,9 @@ export const config = {
9
7
}
10
8
] ,
11
9
engines : {
12
- playwright : { }
10
+ playwright : {
11
+ trace : true
12
+ }
13
13
}
14
14
} ;
15
15
@@ -25,6 +25,34 @@ export const scenarios = [
25
25
{
26
26
engine : 'playwright' ,
27
27
name : 'check_out_core_concepts_scenario' ,
28
- testFunction : checkOutArtilleryCoreConceptsFlow
28
+ testFunction : async function checkOutArtilleryCoreConceptsFlow (
29
+ page ,
30
+ userContext ,
31
+ events ,
32
+ test
33
+ ) {
34
+ await test . step ( 'Go to Artillery' , async ( ) => {
35
+ const requestPromise = page . waitForRequest ( 'https://artillery.io/' ) ;
36
+ await page . goto ( 'https://artillery.io/' ) ;
37
+ const req = await requestPromise ;
38
+ } ) ;
39
+ await test . step ( 'Go to docs' , async ( ) => {
40
+ const docs = await page . getByRole ( 'link' , { name : 'Docs' } ) ;
41
+ await docs . click ( ) ;
42
+ await page . waitForURL ( 'https://www.artillery.io/docs' ) ;
43
+ } ) ;
44
+
45
+ await test . step ( 'Go to core concepts' , async ( ) => {
46
+ await page
47
+ . getByRole ( 'link' , {
48
+ name : 'Review core concepts'
49
+ } )
50
+ . click ( ) ;
51
+
52
+ await page . waitForURL (
53
+ 'https://www.artillery.io/docs/get-started/core-concepts'
54
+ ) ;
55
+ } ) ;
56
+ }
29
57
}
30
58
] ;
Original file line number Diff line number Diff line change @@ -297,6 +297,10 @@ function getCustomJsDependencies(context, next) {
297
297
// Could be JSON files too.
298
298
context . localFilePaths = context . localFilePaths . concat ( tree ) ;
299
299
context . npmModules = context . npmModules . concat ( reduced ) ;
300
+ // Remove duplicate entries for the same file when invoked on a single .ts script
301
+ // See line 44 - the config.processor property is always set on .ts files, which leads to
302
+ // multiple entries in the localFilePaths array for the same file
303
+ context . localFilePaths = _ . uniq ( context . localFilePaths ) ;
300
304
debug ( 'got custom JS dependencies' ) ;
301
305
return next ( null , context ) ;
302
306
} else {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const { test, afterEach } = require ( 'tap' ) ;
4
- const { applyScriptChanges } = require ( '../../lib/platform/aws-ecs/legacy/bom' ) ;
3
+ const promisify = require ( 'util' ) . promisify ;
4
+ const path = require ( 'path' ) ;
5
+ const { test } = require ( 'tap' ) ;
6
+ const {
7
+ createBOM,
8
+ applyScriptChanges
9
+ } = require ( '../../lib/platform/aws-ecs/legacy/bom' ) ;
5
10
6
11
// TODO: Add tests for other functions in bom.js
7
12
13
+ test ( 'Self-contained .ts script with no dependencies' , async ( t ) => {
14
+ const inputFilename = 'browser-load-test.ts' ;
15
+ const inputScript = path . join (
16
+ __dirname ,
17
+ '../../../../examples/browser-load-testing-playwright' ,
18
+ inputFilename
19
+ ) ;
20
+ const createBOMAsync = promisify ( createBOM ) ;
21
+ const bom = await createBOMAsync ( inputScript , [ ] , {
22
+ scenarioPath : inputScript ,
23
+ flags : { }
24
+ } ) ;
25
+ console . log ( bom ) ;
26
+ t . equal (
27
+ bom . files . length ,
28
+ 1 ,
29
+ 'Input file is expected to have no dependencies'
30
+ ) ;
31
+ t . equal ( bom . files [ 0 ] . orig . endsWith ( inputFilename ) , true ) ;
32
+ t . equal (
33
+ bom . files [ 0 ] . noPrefix ,
34
+ inputFilename ,
35
+ 'Unprefixed filename should be the same as the input filename'
36
+ ) ;
37
+ } ) ;
38
+
8
39
test ( 'applyScriptChanges should resolve config templates with cli variables' , async ( t ) => {
9
40
// Arrange
10
41
global . artillery . testRunId = 'bombolini_id_1234567890' ;
You can’t perform that action at this time.
0 commit comments