From 32115b17718016968d1c1902fd6ca174de795226 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sat, 3 Dec 2022 23:19:23 +0800 Subject: [PATCH] fix(playwright): use txt instead of csv for fs reader --- .../fixtures/expectedBaseDownloadData.txt | 110 ++++++++++++++++++ .../fixtures/expectedBaseDownloadDataPg.txt | 110 ++++++++++++++++++ tests/playwright/fixtures/expectedData.txt | 4 + .../fixtures/expectedDataSqlite.txt | 19 +++ .../Dashboard/common/Toolbar/ViewMenu.ts | 8 +- .../pages/Dashboard/common/Toolbar/index.ts | 2 +- tests/playwright/tests/viewGridShare.spec.ts | 2 +- tests/playwright/tests/viewMenu.spec.ts | 4 +- 8 files changed, 251 insertions(+), 8 deletions(-) create mode 100644 tests/playwright/fixtures/expectedBaseDownloadData.txt create mode 100644 tests/playwright/fixtures/expectedBaseDownloadDataPg.txt create mode 100644 tests/playwright/fixtures/expectedData.txt create mode 100644 tests/playwright/fixtures/expectedDataSqlite.txt diff --git a/tests/playwright/fixtures/expectedBaseDownloadData.txt b/tests/playwright/fixtures/expectedBaseDownloadData.txt new file mode 100644 index 0000000000..9002600ee2 --- /dev/null +++ b/tests/playwright/fixtures/expectedBaseDownloadData.txt @@ -0,0 +1,110 @@ +Country,City List +Afghanistan,Kabul +Algeria,"Batna, Bchar, Skikda" +American Samoa,Tafuna +Angola,"Benguela, Namibe" +Anguilla,South Hill +Argentina,"Almirante Brown, Avellaneda, Baha Blanca, Crdoba, Escobar, Ezeiza, La Plata, Merlo, Quilmes, San Miguel de Tucumn, Santa F, Tandil, Vicente Lpez" +Armenia,Yerevan +Australia,Woodridge +Austria,"Graz, Linz, Salzburg" +Azerbaijan,"Baku, Sumqayit" +Bahrain,al-Manama +Bangladesh,"Dhaka, Jamalpur, Tangail" +Belarus,"Mogiljov, Molodetno" +Bolivia,"El Alto, Sucre" +Brazil,"Alvorada, Angra dos Reis, Anpolis, Aparecida de Goinia, Araatuba, Bag, Belm, Blumenau, Boa Vista, Braslia, Goinia, Guaruj, guas Lindas de Gois, Ibirit, Juazeiro do Norte, Juiz de Fora, Luzinia, Maring, Po, Poos de Caldas, Rio Claro, Santa Brbara dOeste, Santo Andr, So Bernardo do Campo, So Leopoldo" +Brunei,Bandar Seri Begawan +Bulgaria,"Ruse, Stara Zagora" +Cambodia,"Battambang, Phnom Penh" +Cameroon,"Bamenda, Yaound" +Canada,"Gatineau, Halifax, Lethbridge, London, Oshawa, Richmond Hill, Vancouver" +Chad,NDjamna +Chile,"Antofagasta, Coquimbo, Rancagua" +China,"Baicheng, Baiyin, Binzhou, Changzhou, Datong, Daxian, Dongying, Emeishan, Enshi, Ezhou, Fuyu, Fuzhou, Haining, Hami, Hohhot, Huaian, Jinchang, Jining, Jinzhou, Junan, Korla, Laiwu, Laohekou, Lengshuijiang, Leshan" +Colombia,"Buenaventura, Dos Quebradas, Florencia, Pereira, Sincelejo, Sogamoso" +"Congo, The Democratic Republic of the","Lubumbashi, Mwene-Ditu" +Czech Republic,Olomouc +Dominican Republic,"La Romana, San Felipe de Puerto Plata, Santiago de los Caballeros" +Ecuador,"Loja, Portoviejo, Robamba" +Egypt,"Bilbays, Idfu, Mit Ghamr, Qalyub, Sawhaj, Shubra al-Khayma" +Estonia,Tartu +Ethiopia,Addis Abeba +Faroe Islands,Trshavn +Finland,Oulu +France,"Brest, Le Mans, Toulon, Toulouse" +French Guiana,Cayenne +French Polynesia,"Faaa, Papeete" +Gambia,Banjul +Germany,"Duisburg, Erlangen, Halle/Saale, Mannheim, Saarbrcken, Siegen, Witten" +Greece,"Athenai, Patras" +Greenland,Nuuk +Holy See (Vatican City State),Citt del Vaticano +Hong Kong,Kowloon and New Kowloon +Hungary,Szkesfehrvr +India,"Adoni, Ahmadnagar, Allappuzha (Alleppey), Ambattur, Amroha, Balurghat, Berhampore (Baharampur), Bhavnagar, Bhilwara, Bhimavaram, Bhopal, Bhusawal, Bijapur, Chandrapur, Chapra, Dhule (Dhulia), Etawah, Firozabad, Gandhinagar, Gulbarga, Haldia, Halisahar, Hoshiarpur, Hubli-Dharwad, Jaipur" +Indonesia,"Cianjur, Ciomas, Ciparay, Gorontalo, Jakarta, Lhokseumawe, Madiun, Pangkal Pinang, Pemalang, Pontianak, Probolinggo, Purwakarta, Surakarta, Tegal" +Iran,"Arak, Esfahan, Kermanshah, Najafabad, Qomsheh, Shahr-e Kord, Sirjan, Tabriz" +Iraq,Mosul +Israel,"Ashdod, Ashqelon, Bat Yam, Tel Aviv-Jaffa" +Italy,"Alessandria, Bergamo, Brescia, Brindisi, Livorno, Syrakusa, Udine" +Japan,"Akishima, Fukuyama, Higashiosaka, Hino, Hiroshima, Isesaki, Iwaki, Iwakuni, Iwatsuki, Izumisano, Kakamigahara, Kamakura, Kanazawa, Koriyama, Kurashiki, Kuwana, Matsue, Miyakonojo, Nagareyama, Okayama, Okinawa, Omiya, Onomichi, Otsu, Sagamihara" +Kazakstan,"Pavlodar, Zhezqazghan" +Kenya,"Kisumu, Nyeri" +Kuwait,Jalib al-Shuyukh +Latvia,"Daugavpils, Liepaja" +Liechtenstein,Vaduz +Lithuania,Vilnius +Madagascar,Mahajanga +Malawi,Lilongwe +Malaysia,"Ipoh, Kuching, Sungai Petani" +Mexico,"Acua, Allende, Atlixco, Carmen, Celaya, Coacalco de Berriozbal, Coatzacoalcos, Cuauhtmoc, Cuautla, Cuernavaca, El Fuerte, Guadalajara, Hidalgo, Huejutla de Reyes, Huixquilucan, Jos Azueta, Jurez, La Paz, Matamoros, Mexicali, Monclova, Nezahualcyotl, Pachuca de Soto, Salamanca, San Felipe del Progreso" +Moldova,Chisinau +Morocco,"Beni-Mellal, Nador, Sal" +Mozambique,"Beira, Naala-Porto, Tete" +Myanmar,"Monywa, Myingyan" +Nauru,Yangor +Nepal,Birgunj +Netherlands,"Amersfoort, Apeldoorn, Ede, Emmen, s-Hertogenbosch" +New Zealand,Hamilton +Nigeria,"Benin City, Deba Habe, Effon-Alaiye, Ife, Ikerre, Ilorin, Kaduna, Ogbomosho, Ondo, Owo, Oyo, Sokoto, Zaria" +North Korea,Pyongyang +Oman,"Masqat, Salala" +Pakistan,"Dadu, Mandi Bahauddin, Mardan, Okara, Shikarpur" +Paraguay,"Asuncin, Ciudad del Este, San Lorenzo" +Peru,"Callao, Hunuco, Lima, Sullana" +Philippines,"Baybay, Bayugan, Bislig, Cabuyao, Cavite, Davao, Gingoog, Hagonoy, Iligan, Imus, Lapu-Lapu, Mandaluyong, Ozamis, Santa Rosa, Taguig, Talavera, Tanauan, Tanza, Tarlac, Tuguegarao" +Poland,"Bydgoszcz, Czestochowa, Jastrzebie-Zdrj, Kalisz, Lublin, Plock, Tychy, Wroclaw" +Puerto Rico,"Arecibo, Ponce" +Romania,"Botosani, Bucuresti" +Runion,Saint-Denis +Russian Federation,"Atinsk, Balaiha, Dzerzinsk, Elista, Ivanovo, Jaroslavl, Jelets, Kaliningrad, Kamyin, Kirovo-Tepetsk, Kolpino, Korolev, Kurgan, Kursk, Lipetsk, Ljubertsy, Maikop, Moscow, Nabereznyje Telny, Niznekamsk, Novoterkassk, Pjatigorsk, Serpuhov, Smolensk, Syktyvkar" +Saint Vincent and the Grenadines,Kingstown +Saudi Arabia,"Abha, al-Hawiya, al-Qatif, Jedda, Tabuk" +Senegal,Ziguinchor +Slovakia,Bratislava +South Africa,"Boksburg, Botshabelo, Chatsworth, Johannesburg, Kimberley, Klerksdorp, Newcastle, Paarl, Rustenburg, Soshanguve, Springs" +South Korea,"Cheju, Kimchon, Naju, Tonghae, Uijongbu" +Spain,"A Corua (La Corua), Donostia-San Sebastin, Gijn, Ourense (Orense), Santiago de Compostela" +Sri Lanka,Jaffna +Sudan,"al-Qadarif, Omdurman" +Sweden,Malm +Switzerland,"Basel, Bern, Lausanne" +Taiwan,"Changhwa, Chiayi, Chungho, Fengshan, Hsichuh, Lungtan, Nantou, Tanshui, Touliu, Tsaotun" +Tanzania,"Mwanza, Tabora, Zanzibar" +Thailand,"Nakhon Sawan, Pak Kret, Songkhla" +Tonga,Nukualofa +Tunisia,Sousse +Turkey,"Adana, Balikesir, Batman, Denizli, Eskisehir, Gaziantep, Inegl, Kilis, Ktahya, Osmaniye, Sivas, Sultanbeyli, Tarsus, Tokat, Usak" +Turkmenistan,Ashgabat +Tuvalu,Funafuti +Ukraine,"Kamjanets-Podilskyi, Konotop, Mukateve, ostka, Simferopol, Sumy" +United Arab Emirates,"Abu Dhabi, al-Ayn, Sharja" +United Kingdom,"Bradford, Dundee, London, Southampton, Southend-on-Sea, Southport, Stockport, York" +United States,"Akron, Arlington, Augusta-Richmond County, Aurora, Bellevue, Brockton, Cape Coral, Citrus Heights, Clarksville, Compton, Dallas, Dayton, El Monte, Fontana, Garden Grove, Garland, Grand Prairie, Greensboro, Joliet, Kansas City, Lancaster, Laredo, Lincoln, Manchester, Memphis" +Venezuela,"Barcelona, Caracas, Cuman, Maracabo, Ocumare del Tuy, Valencia, Valle de la Pascua" +Vietnam,"Cam Ranh, Haiphong, Hanoi, Nam Dinh, Nha Trang, Vinh" +"Virgin Islands, U.S.",Charlotte Amalie +Yemen,"Aden, Hodeida, Sanaa, Taizz" +Yugoslavia,"Kragujevac, Novi Sad" +Zambia,Kitwe \ No newline at end of file diff --git a/tests/playwright/fixtures/expectedBaseDownloadDataPg.txt b/tests/playwright/fixtures/expectedBaseDownloadDataPg.txt new file mode 100644 index 0000000000..ffce972614 --- /dev/null +++ b/tests/playwright/fixtures/expectedBaseDownloadDataPg.txt @@ -0,0 +1,110 @@ +Country,City List +Afghanistan,Kabul +Algeria,"Batna, Bchar, Skikda" +American Samoa,Tafuna +Angola,"Benguela, Namibe" +Anguilla,South Hill +Argentina,"Almirante Brown, Avellaneda, Baha Blanca, Crdoba, Escobar, Ezeiza, La Plata, Merlo, Quilmes, San Miguel de Tucumn, Santa F, Tandil, Vicente Lpez" +Armenia,Yerevan +Australia,Woodridge +Austria,"Graz, Linz, Salzburg" +Azerbaijan,"Baku, Sumqayit" +Bahrain,al-Manama +Bangladesh,"Dhaka, Jamalpur, Tangail" +Belarus,"Mogiljov, Molodetno" +Bolivia,"El Alto, Sucre" +Brazil,"Alvorada, Angra dos Reis, Anpolis, Aparecida de Goinia, Araatuba, Bag, Belm, Blumenau, Boa Vista, Braslia, Goinia, Guaruj, guas Lindas de Gois, Ibirit, Juazeiro do Norte, Juiz de Fora, Luzinia, Maring, Po, Poos de Caldas, Rio Claro, Santa Brbara dOeste, Santo Andr, So Bernardo do Campo, So Leopoldo" +Brunei,Bandar Seri Begawan +Bulgaria,"Ruse, Stara Zagora" +Cambodia,"Battambang, Phnom Penh" +Cameroon,"Bamenda, Yaound" +Canada,"Gatineau, Halifax, Lethbridge, London, Oshawa, Richmond Hill, Vancouver" +Chad,NDjamna +Chile,"Antofagasta, Coquimbo, Rancagua" +China,"Baicheng, Baiyin, Binzhou, Changzhou, Datong, Daxian, Dongying, Emeishan, Enshi, Ezhou, Fuyu, Fuzhou, Haining, Hami, Hohhot, Huaian, Jinchang, Jining, Jinzhou, Junan, Korla, Laiwu, Laohekou, Lengshuijiang, Leshan" +Colombia,"Buenaventura, Dos Quebradas, Florencia, Pereira, Sincelejo, Sogamoso" +"Congo, The Democratic Republic of the","Lubumbashi, Mwene-Ditu" +Czech Republic,Olomouc +Dominican Republic,"La Romana, San Felipe de Puerto Plata, Santiago de los Caballeros" +Ecuador,"Loja, Portoviejo, Robamba" +Egypt,"Bilbays, Idfu, Mit Ghamr, Qalyub, Sawhaj, Shubra al-Khayma" +Estonia,Tartu +Ethiopia,Addis Abeba +Faroe Islands,Trshavn +Finland,Oulu +France,"Brest, Le Mans, Toulon, Toulouse" +French Guiana,Cayenne +French Polynesia,"Faaa, Papeete" +Gambia,Banjul +Germany,"Duisburg, Erlangen, Halle/Saale, Mannheim, Saarbrcken, Siegen, Witten" +Greece,"Athenai, Patras" +Greenland,Nuuk +Holy See (Vatican City State),Citt del Vaticano +Hong Kong,Kowloon and New Kowloon +Hungary,Szkesfehrvr +India,"Adoni, Ahmadnagar, Allappuzha (Alleppey), Ambattur, Amroha, Balurghat, Berhampore (Baharampur), Bhavnagar, Bhilwara, Bhimavaram, Bhopal, Bhusawal, Bijapur, Chandrapur, Chapra, Dhule (Dhulia), Etawah, Firozabad, Gandhinagar, Gulbarga, Haldia, Halisahar, Hoshiarpur, Hubli-Dharwad, Jaipur" +Indonesia,"Cianjur, Ciomas, Ciparay, Gorontalo, Jakarta, Lhokseumawe, Madiun, Pangkal Pinang, Pemalang, Pontianak, Probolinggo, Purwakarta, Surakarta, Tegal" +Iran,"Arak, Esfahan, Kermanshah, Najafabad, Qomsheh, Shahr-e Kord, Sirjan, Tabriz" +Iraq,Mosul +Israel,"Ashdod, Ashqelon, Bat Yam, Tel Aviv-Jaffa" +Italy,"Alessandria, Bergamo, Brescia, Brindisi, Livorno, Syrakusa, Udine" +Japan,"Akishima, Fukuyama, Higashiosaka, Hino, Hiroshima, Isesaki, Iwaki, Iwakuni, Iwatsuki, Izumisano, Kakamigahara, Kamakura, Kanazawa, Koriyama, Kurashiki, Kuwana, Matsue, Miyakonojo, Nagareyama, Okayama, Okinawa, Omiya, Onomichi, Otsu, Sagamihara" +Kazakstan,"Pavlodar, Zhezqazghan" +Kenya,"Kisumu, Nyeri" +Kuwait,Jalib al-Shuyukh +Latvia,"Daugavpils, Liepaja" +Liechtenstein,Vaduz +Lithuania,Vilnius +Madagascar,Mahajanga +Malawi,Lilongwe +Malaysia,"Ipoh, Kuching, Sungai Petani" +Mexico,"Acua, Allende, Atlixco, Carmen, Celaya, Coacalco de Berriozbal, Coatzacoalcos, Cuauhtmoc, Cuautla, Cuernavaca, El Fuerte, Guadalajara, Hidalgo, Huejutla de Reyes, Huixquilucan, Jos Azueta, Jurez, La Paz, Matamoros, Mexicali, Monclova, Nezahualcyotl, Pachuca de Soto, Salamanca, San Felipe del Progreso" +Moldova,Chisinau +Morocco,"Beni-Mellal, Nador, Sal" +Mozambique,"Beira, Naala-Porto, Tete" +Myanmar,"Monywa, Myingyan" +Nauru,Yangor +Nepal,Birgunj +Netherlands,"Amersfoort, Apeldoorn, Ede, Emmen, s-Hertogenbosch" +New Zealand,Hamilton +Nigeria,"Benin City, Deba Habe, Effon-Alaiye, Ife, Ikerre, Ilorin, Kaduna, Ogbomosho, Ondo, Owo, Oyo, Sokoto, Zaria" +North Korea,Pyongyang +Oman,"Masqat, Salala" +Pakistan,"Dadu, Mandi Bahauddin, Mardan, Okara, Shikarpur" +Paraguay,"Asuncin, Ciudad del Este, San Lorenzo" +Peru,"Callao, Hunuco, Lima, Sullana" +Philippines,"Baybay, Bayugan, Bislig, Cabuyao, Cavite, Davao, Gingoog, Hagonoy, Iligan, Imus, Lapu-Lapu, Mandaluyong, Ozamis, Santa Rosa, Taguig, Talavera, Tanauan, Tanza, Tarlac, Tuguegarao" +Poland,"Bydgoszcz, Czestochowa, Jastrzebie-Zdrj, Kalisz, Lublin, Plock, Tychy, Wroclaw" +Puerto Rico,"Arecibo, Ponce" +Romania,"Botosani, Bucuresti" +Runion,Saint-Denis +Russian Federation,"Atinsk, Balaiha, Dzerzinsk, Elista, Ivanovo, Jaroslavl, Jelets, Kaliningrad, Kamyin, Kirovo-Tepetsk, Kolpino, Korolev, Kurgan, Kursk, Lipetsk, Ljubertsy, Maikop, Moscow, Nabereznyje Telny, Niznekamsk, Novoterkassk, Pjatigorsk, Serpuhov, Smolensk, Syktyvkar" +Saint Vincent and the Grenadines,Kingstown +Saudi Arabia,"Abha, al-Hawiya, al-Qatif, Jedda, Tabuk" +Senegal,Ziguinchor +Slovakia,Bratislava +South Africa,"Boksburg, Botshabelo, Chatsworth, Johannesburg, Kimberley, Klerksdorp, Newcastle, Paarl, Rustenburg, Soshanguve, Springs" +South Korea,"Cheju, Kimchon, Naju, Tonghae, Uijongbu" +Spain,"A Corua (La Corua), Donostia-San Sebastin, Gijn, Ourense (Orense), Santiago de Compostela" +Sri Lanka,Jaffna +Sudan,"al-Qadarif, Omdurman" +Sweden,Malm +Switzerland,"Basel, Bern, Lausanne" +Taiwan,"Changhwa, Chiayi, Chungho, Fengshan, Hsichuh, Lungtan, Nantou, Tanshui, Touliu, Tsaotun" +Tanzania,"Mwanza, Tabora, Zanzibar" +Thailand,"Nakhon Sawan, Pak Kret, Songkhla" +Tonga,Nukualofa +Tunisia,Sousse +Turkey,"Adana, Balikesir, Batman, Denizli, Eskisehir, Gaziantep, Inegl, Kilis, Ktahya, Osmaniye, Sivas, Sultanbeyli, Tarsus, Tokat, Usak" +Turkmenistan,Ashgabat +Tuvalu,Funafuti +Ukraine,"Kamjanets-Podilskyi, Konotop, Mukateve, ostka, Simferopol, Sumy" +United Arab Emirates,"Abu Dhabi, al-Ayn, Sharja" +United Kingdom,"Bradford, Dundee, London, Southampton, Southend-on-Sea, Southport, Stockport, York" +United States,"Akron, Arlington, Augusta-Richmond County, Aurora, Bellevue, Brockton, Cape Coral, Citrus Heights, Clarksville, Compton, Dallas, Dayton, El Monte, Fontana, Garden Grove, Garland, Grand Prairie, Greensboro, Joliet, Kansas City, Lancaster, Laredo, Lincoln, Manchester, Memphis" +Venezuela,"Barcelona, Caracas, Cuman, Maracabo, Ocumare del Tuy, Valencia, Valle de la Pascua" +Vietnam,"Cam Ranh, Haiphong, Hanoi, Nam Dinh, Nha Trang, Vinh" +"Virgin Islands, U.S.",Charlotte Amalie +Yemen,"Aden, Hodeida, Sanaa, Taizz" +Yugoslavia,"Kragujevac, Novi Sad" +Zambia,Kitwe \ No newline at end of file diff --git a/tests/playwright/fixtures/expectedData.txt b/tests/playwright/fixtures/expectedData.txt new file mode 100644 index 0000000000..6de66cde96 --- /dev/null +++ b/tests/playwright/fixtures/expectedData.txt @@ -0,0 +1,4 @@ +Address,District,PostalCode,Phone,Location,Customer List,Staff List,City,Staff List1 +1661 Abha Drive,Tamil Nadu,14400,270456873752,"{""x"":78.8214191,""y"":10.3812871}",1,,Pudukkottai, +1993 Tabuk Lane,Tamil Nadu,64221,648482415405,"{""x"":80.1270701,""y"":12.9246028}",2,,Tambaram, +381 Kabul Way,Taipei,87272,55477302294,"{""x"":0,""y"":0}",2,,Hsichuh, \ No newline at end of file diff --git a/tests/playwright/fixtures/expectedDataSqlite.txt b/tests/playwright/fixtures/expectedDataSqlite.txt new file mode 100644 index 0000000000..cbf8d9cccb --- /dev/null +++ b/tests/playwright/fixtures/expectedDataSqlite.txt @@ -0,0 +1,19 @@ +Address,District,PostalCode,Phone,Customer List,Staff List,City,Staff List1 +1013 Tabuk Boulevard," ",96203," ",2,,Kanchrapara, +1168 Najafabad Parkway," ",40301," ",1,,Kabul, +1294 Firozabad Drive," ",70618," ",2,,Pingxiang, +1342 Abha Boulevard," ",10714," ",2,,Bucuresti, +1368 Maracabo Boulevard," ",32716," ",2,,South Hill, +1427 Tabuk Place," ",31342," ",2,,Cape Coral, +1519 Santiago de los Caballeros Loop," ",22025," ",2,,Mwene-Ditu, +1661 Abha Drive," ",14400," ",1,,Pudukkottai, +17 Kabul Boulevard," ",38594," ",1,,Nagareyama, +1838 Tabriz Lane," ",1195," ",1,,Dhaka, +1888 Kabul Drive," ",20936," ",1,,Ife, +1892 Nabereznyje Telny Lane," ",28396," ",2,,Tafuna, +1993 Tabuk Lane," ",64221," ",2,,Tambaram, +217 Botshabelo Place," ",49521," ",2,,Davao, +381 Kabul Way," ",87272," ",2,,Hsichuh, +44 Najafabad Way," ",61391," ",2,,Donostia-San Sebastin, +48 Maracabo Place," ",1570," ",1,,Talavera, +669 Firozabad Loop," ",92265," ",1,,al-Ayn, \ No newline at end of file diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts index e5a4b050da..838bf6adbf 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts @@ -66,11 +66,11 @@ export class ToolbarViewMenuPage extends BasePage { // convert xlsx to csv const wb = XLSX.readFile('./output/test.xlsx'); - XLSX.writeFile(wb, './output/test.csv', { bookType: 'csv' }); + XLSX.writeFile(wb, './output/test.txt', { bookType: 'csv' }); // verify downloaded content against expected content const expectedData = fs.readFileSync(expectedDataFile, 'utf8'); - const file = fs.readFileSync('./output/test.csv', 'utf8'); + const file = fs.readFileSync('./output/test.txt', 'utf8'); await expect(file).toEqual(expectedData); } @@ -94,14 +94,14 @@ export class ToolbarViewMenuPage extends BasePage { downloadLocator: await this.rootPage .locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`) .last(), - expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.csv', + expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', }); } else if (subMenu === 'Download as XLSX') { await this.verifyDownloadAsXLSX({ downloadLocator: await this.rootPage .locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`) .last(), - expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.csv', + expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt', }); } else { await this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last().click(); diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts index f33b6bd1bd..02c1f6bedb 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/index.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/index.ts @@ -111,7 +111,7 @@ export class ToolbarPage extends BasePage { await this.get().locator(`.nc-toolbar-btn.nc-add-new-row-btn`).click(); } - async clickDownload(type: string, verificationFile = 'expectedData.csv') { + async clickDownload(type: string, verificationFile = 'expectedData.txt') { await this.get().locator(`.nc-toolbar-btn.nc-actions-menu-btn`).click(); const [download] = await Promise.all([ diff --git a/tests/playwright/tests/viewGridShare.spec.ts b/tests/playwright/tests/viewGridShare.spec.ts index 61b6c1f73c..6e6f82baa5 100644 --- a/tests/playwright/tests/viewGridShare.spec.ts +++ b/tests/playwright/tests/viewGridShare.spec.ts @@ -139,7 +139,7 @@ test.describe('Shared view', () => { // verify download await sharedPage.grid.toolbar.clickDownload( 'Download as CSV', - isSqlite(context) || isPg(context) ? 'expectedDataSqlite.csv' : 'expectedData.csv' + isSqlite(context) || isPg(context) ? 'expectedDataSqlite.txt' : 'expectedData.txt' ); }); diff --git a/tests/playwright/tests/viewMenu.spec.ts b/tests/playwright/tests/viewMenu.spec.ts index 521549c5ae..39ac76bd33 100644 --- a/tests/playwright/tests/viewMenu.spec.ts +++ b/tests/playwright/tests/viewMenu.spec.ts @@ -52,7 +52,7 @@ test.describe('Grid view locked', () => { menu: 'Download', subMenu: 'Download as CSV', verificationInfo: { - verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.csv' : null, + verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, }, }); }); @@ -72,7 +72,7 @@ test.describe('Grid view locked', () => { menu: 'Download', subMenu: 'Download as XLSX', verificationInfo: { - verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.csv' : null, + verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null, }, }); });