import AppHomePage from '../pages/v10/app-home.po.js'
import Routing from '../pages/routing.js';
import BaseActions from '../actions/base-actions.js'
import EuiDialogActions from '../actions/eui-dialog-actions.js'

describe('02. Translations test', async () => {
  let homePage = new AppHomePage();

  it('should open home page', async () => {
    browser.addTestMeta({
      uuid: "dafca951-226d-4d6d-98c8-d94572ddbc8a", zephyrKey: "XXXX-999", zephyrStep: "9999991", reportGroups: ["GENERAL"],
      testedSystems: []
    });
    await homePage.open(Routing.homeUrl);
    await expect(await homePage.euiAppCO.euiAppToolbarCO.element()).toBeDisplayed({ wait: 40000, message: 'EUI App toolbar did not appear' });
  }, 3);
  
  it('should open eui-dialog page', async () => {
    await homePage.open(Routing.euiDialogComponent);
  });
  
  it('should change the language to FR', async () => {
    await BaseActions.changeLang('fr');
  });
  
  it('should open eui-dialog component', async () => {
    await EuiDialogActions.openDialog();
  });
  
  it('should verify the Cancel button transaltion and close dialog', async () => {
    await EuiDialogActions.verifyCancelButtonTranslation('fr');
    await EuiDialogActions.closeDialog();
  });
  
  it('network log', async () => {
    browser.logPuppeteerNetwork();
  });
})
