Browse Source

fix(playwright): use txt instead of csv for fs reader

pull/4581/head
Wing-Kam Wong 2 years ago
parent
commit
32115b1771
  1. 110
      tests/playwright/fixtures/expectedBaseDownloadData.txt
  2. 110
      tests/playwright/fixtures/expectedBaseDownloadDataPg.txt
  3. 4
      tests/playwright/fixtures/expectedData.txt
  4. 19
      tests/playwright/fixtures/expectedDataSqlite.txt
  5. 8
      tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
  6. 2
      tests/playwright/pages/Dashboard/common/Toolbar/index.ts
  7. 2
      tests/playwright/tests/viewGridShare.spec.ts
  8. 4
      tests/playwright/tests/viewMenu.spec.ts

110
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

110
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

4
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,

19
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,

8
tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts

@ -66,11 +66,11 @@ export class ToolbarViewMenuPage extends BasePage {
// convert xlsx to csv // convert xlsx to csv
const wb = XLSX.readFile('./output/test.xlsx'); 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 // verify downloaded content against expected content
const expectedData = fs.readFileSync(expectedDataFile, 'utf8'); 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); await expect(file).toEqual(expectedData);
} }
@ -94,14 +94,14 @@ export class ToolbarViewMenuPage extends BasePage {
downloadLocator: await this.rootPage downloadLocator: await this.rootPage
.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`) .locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`)
.last(), .last(),
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.csv', expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
}); });
} else if (subMenu === 'Download as XLSX') { } else if (subMenu === 'Download as XLSX') {
await this.verifyDownloadAsXLSX({ await this.verifyDownloadAsXLSX({
downloadLocator: await this.rootPage downloadLocator: await this.rootPage
.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`) .locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`)
.last(), .last(),
expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.csv', expectedDataFile: verificationInfo?.verificationFile ?? './fixtures/expectedBaseDownloadData.txt',
}); });
} else { } else {
await this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last().click(); await this.rootPage.locator(`.ant-dropdown-menu-title-content:has-text("${subMenu}")`).last().click();

2
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(); 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(); await this.get().locator(`.nc-toolbar-btn.nc-actions-menu-btn`).click();
const [download] = await Promise.all([ const [download] = await Promise.all([

2
tests/playwright/tests/viewGridShare.spec.ts

@ -139,7 +139,7 @@ test.describe('Shared view', () => {
// verify download // verify download
await sharedPage.grid.toolbar.clickDownload( await sharedPage.grid.toolbar.clickDownload(
'Download as CSV', 'Download as CSV',
isSqlite(context) || isPg(context) ? 'expectedDataSqlite.csv' : 'expectedData.csv' isSqlite(context) || isPg(context) ? 'expectedDataSqlite.txt' : 'expectedData.txt'
); );
}); });

4
tests/playwright/tests/viewMenu.spec.ts

@ -52,7 +52,7 @@ test.describe('Grid view locked', () => {
menu: 'Download', menu: 'Download',
subMenu: 'Download as CSV', subMenu: 'Download as CSV',
verificationInfo: { 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', menu: 'Download',
subMenu: 'Download as XLSX', subMenu: 'Download as XLSX',
verificationInfo: { verificationInfo: {
verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.csv' : null, verificationFile: isPg(context) ? './fixtures/expectedBaseDownloadDataPg.txt' : null,
}, },
}); });
}); });

Loading…
Cancel
Save