@@ -3,10 +3,11 @@ import Popup from 'devextreme-testcafe-models/popup';
33import Popover from 'devextreme-testcafe-models/popover' ;
44import Toolbar from 'devextreme-testcafe-models/toolbar/toolbar' ;
55import { Selector } from 'testcafe' ;
6- import { testScreenshot } from '../../../helpers/themeUtils' ;
6+ import { isMaterial , testScreenshot } from '../../../helpers/themeUtils' ;
77import url from '../../../helpers/getPageUrl' ;
88import { createWidget } from '../../../helpers/createWidget' ;
99import { safeSizeTest } from '../../../helpers/safeSizeTest' ;
10+ import { insertStylesheetRulesToPage , setStyleAttribute } from '../../../helpers/domUtils' ;
1011
1112fixture `Popup_toolbar`
1213 . page ( url ( __dirname , '../../container.html' ) ) ;
@@ -40,90 +41,95 @@ const ANIMATION_DELAY = 500;
4041 await t
4142 . expect ( compareResults . isValid ( ) )
4243 . ok ( compareResults . errorMessages ( ) ) ;
43- } , [ 600 , 400 ] ) . before ( async ( ) => createWidget ( name as 'dxPopup' | 'dxPopover' , {
44- showCloseButton : true ,
45- // eslint-disable-next-line no-multi-str
46- contentTemplate : ( ) => $ ( '<div>' ) . text ( '\
47- Lorem Ipsum is simply dummy text of the printing and typesetting industry.\
48- Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,\
49- when an unknown printer took a galley of type and scrambled it to make a type specimen book.\
50- ' ) ,
51- width : '60%' ,
52- height : 300 ,
53- showTitle : true ,
54- rtlEnabled,
55- visible : true ,
56- animation : undefined ,
57- target : COMPONENT_SELECTOR ,
58- hideOnOutsideClick : true ,
59- toolbarItems : [ {
60- location : 'before' ,
61- widget : 'dxButton' ,
62- options : {
63- icon : 'back' ,
64- } ,
65- toolbar,
66- } , {
67- location : 'before' ,
68- widget : 'dxButton' ,
69- locateInMenu : 'auto' ,
70- options : {
71- icon : 'refresh' ,
72- } ,
73- toolbar,
74- } , {
75- location : 'center' ,
76- locateInMenu : 'never' ,
77- template ( ) {
78- return $ ( '<div><b>Popup\'s</b> title</div>' ) ;
79- } ,
80- toolbar,
81- } , {
82- location : 'after' ,
83- widget : 'dxSelectBox' ,
84- locateInMenu : 'auto' ,
85- options : {
86- width : 140 ,
87- items : [ 1 , 2 , 3 , 4 , 5 ] ,
88- value : 3 ,
89- } ,
90- toolbar,
91- } , {
92- location : 'after' ,
93- widget : 'dxButton' ,
94- locateInMenu : 'auto' ,
95- options : {
96- icon : 'plus' ,
97- } ,
98- toolbar,
99- } , {
100- locateInMenu : 'always' ,
101- widget : 'dxButton' ,
102- options : {
103- icon : 'save' ,
104- text : 'Save' ,
105- } ,
106- toolbar,
107- } , {
108- widget : 'dxButton' ,
109- toolbar : toolbar === 'top'
110- ? 'bottom'
111- : 'top' ,
112- location : 'before' ,
113- options : {
114- icon : 'email' ,
115- } ,
116- } , {
117- widget : 'dxButton' ,
118- toolbar : toolbar === 'top'
119- ? 'bottom'
120- : 'top' ,
121- location : 'after' ,
122- options : {
123- text : 'Close' ,
124- } ,
125- } ] ,
126- } ) ) ;
44+ } , [ 600 , 400 ] ) . before ( async ( ) => {
45+ if ( isMaterial ( ) ) {
46+ await setStyleAttribute ( Selector ( '.dx-overlay-wrapper' ) , 'font-family: sans-serif !important;' ) ;
47+ }
48+ return createWidget ( name as 'dxPopup' | 'dxPopover' , {
49+ showCloseButton : true ,
50+ // eslint-disable-next-line no-multi-str
51+ contentTemplate : ( ) => $ ( '<div>' ) . text ( '\
52+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.\
53+ Lorem Ipsum has been the industrys standard dummy text ever since the 1500s,\
54+ when an unknown printer took a galley of type and scrambled it to make a type specimen book.\
55+ ' ) ,
56+ width : '60%' ,
57+ height : 300 ,
58+ showTitle : true ,
59+ rtlEnabled,
60+ visible : true ,
61+ animation : undefined ,
62+ target : COMPONENT_SELECTOR ,
63+ hideOnOutsideClick : true ,
64+ toolbarItems : [ {
65+ location : 'before' ,
66+ widget : 'dxButton' ,
67+ options : {
68+ icon : 'back' ,
69+ } ,
70+ toolbar,
71+ } , {
72+ location : 'before' ,
73+ widget : 'dxButton' ,
74+ locateInMenu : 'auto' ,
75+ options : {
76+ icon : 'refresh' ,
77+ } ,
78+ toolbar,
79+ } , {
80+ location : 'center' ,
81+ locateInMenu : 'never' ,
82+ template ( ) {
83+ return $ ( '<div><b>Popup\'s</b> title</div>' ) ;
84+ } ,
85+ toolbar,
86+ } , {
87+ location : 'after' ,
88+ widget : 'dxSelectBox' ,
89+ locateInMenu : 'auto' ,
90+ options : {
91+ width : 140 ,
92+ items : [ 1 , 2 , 3 , 4 , 5 ] ,
93+ value : 3 ,
94+ } ,
95+ toolbar,
96+ } , {
97+ location : 'after' ,
98+ widget : 'dxButton' ,
99+ locateInMenu : 'auto' ,
100+ options : {
101+ icon : 'plus' ,
102+ } ,
103+ toolbar,
104+ } , {
105+ locateInMenu : 'always' ,
106+ widget : 'dxButton' ,
107+ options : {
108+ icon : 'save' ,
109+ text : 'Save' ,
110+ } ,
111+ toolbar,
112+ } , {
113+ widget : 'dxButton' ,
114+ toolbar : toolbar === 'top'
115+ ? 'bottom'
116+ : 'top' ,
117+ location : 'before' ,
118+ options : {
119+ icon : 'email' ,
120+ } ,
121+ } , {
122+ widget : 'dxButton' ,
123+ toolbar : toolbar === 'top'
124+ ? 'bottom'
125+ : 'top' ,
126+ location : 'after' ,
127+ options : {
128+ text : 'Close' ,
129+ } ,
130+ } ] ,
131+ } )
132+ } ) ;
127133 } ) ;
128134 } ) ;
129135} ) ;
0 commit comments