/* eslint-disable linebreak-style */ import 'codeceptjs'; import { lmt } from '../Helpers/readI18NProp'; import { logger } from '../Logger/logger'; import { CommonKeyword } from './commonKeyword'; import { DewElement } from './element'; /** * Login History related class */ export class LoginHistory { /** * Verify Login history for the user * * ```js * LoginHistory.checkHistory(); * */ static async checkHistory() { try { navigateToLoginHistory(); await DewElement.verifyIfISeeText(await lmt.getLabel(`Date`)); await DewElement.verifyIfISeeText(await lmt.getLabel(`IP`)); /* z.see(await lmt.getLabel(`Date`)); z.see(await lmt.getLabel(`IP`)); */ } catch (error) { logger.log(`Issue while performing operation in DDCC: Error while checking login history`); throw error; } } } /** * Navigate to Login History */ async function navigateToLoginHistory() { try { await DewElement.verifyIfISeeElement(`.//dew-dropdown[contains(@class,'profile')]`); await CommonKeyword.click(`.//dew-dropdown[contains(@class,'profile')]`); await CommonKeyword.click(`.//div[contains(@class,'dropdown-item') and text()[normalize-space()='${await lmt.getLabel(`Login History`)}']]`); await DewElement.verifyIfISeeElement(`.//dew-modal-header//span[text()='${await lmt.getLabel(`Login History`)}']`); } catch (error) { logger.log(`Issue while performing operation in DDCC: Error while navigating to Login history`); throw error; } }