1111 * limitations under the License.
1212 */
1313
14- import { expect , Page } from '@playwright/test' ;
15- import { redirectToHomePage } from '../../utils/common' ;
14+ import { expect } from '@playwright/test' ;
15+ import { performAdminLogin } from '../../utils/admin' ;
16+ import { redirectToExplorePage } from '../../utils/common' ;
1617import { waitForAllLoadersToDisappear } from '../../utils/entity' ;
1718import {
1819 countCsvResponseRows ,
@@ -22,15 +23,29 @@ import {
2223} from '../../utils/explore' ;
2324import { test } from '../fixtures/pages' ;
2425
25- const navigateToExplorePage = async ( page : Page ) => {
26- await redirectToHomePage ( page ) ;
27- await page . getByTestId ( 'app-bar-item-explore' ) . click ( ) ;
28- await expect ( page . getByTestId ( 'explore-page' ) ) . toBeVisible ( ) ;
29- } ;
30-
3126test . describe ( 'Search Export' , { tag : [ '@Features' , '@Discovery' ] } , ( ) => {
27+ test . beforeAll ( async ( { browser } ) => {
28+ const { apiContext, afterAction } = await performAdminLogin ( browser ) ;
29+
30+ const serviceRes = await apiContext . get (
31+ '/api/v1/services/databaseServices/name/sample_data'
32+ ) ;
33+ const service = await serviceRes . json ( ) ;
34+ if ( service . displayName ) {
35+ await apiContext . patch (
36+ `/api/v1/services/databaseServices/${ service . id } ` ,
37+ {
38+ data : [ { op : 'replace' , path : '/displayName' , value : 'sample_data' } ] ,
39+ headers : { 'Content-Type' : 'application/json-patch+json' } ,
40+ }
41+ ) ;
42+
43+ await afterAction ( ) ;
44+ }
45+ } ) ;
46+
3247 test . beforeEach ( async ( { page } ) => {
33- await navigateToExplorePage ( page ) ;
48+ await redirectToExplorePage ( page ) ;
3449 } ) ;
3550
3651 test ( 'Export button opens scope modal with correct options' , async ( {
0 commit comments