File tree Expand file tree Collapse file tree 4 files changed +23
-10
lines changed
test_cases/web_content/cookbook/chart_types Expand file tree Collapse file tree 4 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ class TestCaseResult {
120120 } else {
121121 if (
122122 this . #testCaseObj. createImages !== "DISABLED" &&
123- this . #vizzuUrl !== this . #vizzuRefUrl
123+ this . #vizzuRefUrl && this . # vizzuUrl !== this . #vizzuRefUrl
124124 ) {
125125 let testCaseObj = Object . assign ( { } , this . #testCaseObj) ;
126126 testCaseObj . createImages = "ALL" ;
Original file line number Diff line number Diff line change @@ -243,11 +243,17 @@ class TestSuite {
243243 ) ;
244244 } ) ;
245245
246- this . #vizzuRefUrlReady = VizzuUrl . resolveVizzuUrl (
247- this . #vizzuRefUrl,
248- TestEnv . getWorkspacePath ( ) ,
249- TestEnv . getTestSuitePath ( )
250- ) ;
246+ this . #vizzuRefUrlReady = new Promise ( resolve => {
247+ return VizzuUrl . resolveVizzuUrl (
248+ this . #vizzuRefUrl,
249+ TestEnv . getWorkspacePath ( ) ,
250+ TestEnv . getTestSuitePath ( )
251+ ) . then ( ( url ) => {
252+ return resolve ( url ) ;
253+ } ) . catch ( ( ) => {
254+ return resolve ( "" ) ;
255+ } )
256+ } ) ;
251257 startTestSuiteReady . push ( this . #vizzuRefUrlReady) ;
252258 this . #vizzuRefUrlReady. then ( ( url ) => {
253259 this . #vizzuRefUrl = url ;
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ class VizzuUrl {
111111 return resolve ( url ) ;
112112 }
113113 return reject ( response . status ) ;
114+ } ) . catch ( ( err ) => {
115+ return reject ( err ) ;
114116 } ) ;
115117 } ) ;
116118 }
Original file line number Diff line number Diff line change @@ -4,10 +4,15 @@ const testSteps = [
44 async chart =>
55 {
66 function urlToImage ( url ) {
7- return new Promise ( resolve => {
8- const image = new Image ( ) ;
9- image . addEventListener ( 'load' , ( ) => { resolve ( image ) ; } ) ;
10- image . src = url ;
7+ return new Promise ( ( resolve , reject ) => {
8+ const image = new Image ( ) ;
9+ image . addEventListener ( 'load' , ( ) => {
10+ resolve ( image ) ;
11+ } ) ;
12+ image . addEventListener ( 'error' , ( ) => {
13+ reject ( new Error ( 'Failed to load image: ' + url ) ) ;
14+ } ) ;
15+ image . src = url ;
1116 } ) ;
1217 }
1318
You can’t perform that action at this time.
0 commit comments