const Logger= require('../entity/Logger.js'); const logger=Logger.logger; const tempOutputPath=Logger.tempOutputPath; const key = require('selenium-webdriver').Key; const page=require('./Page.js'); const webdriver = require('selenium-webdriver'), chrome = require('selenium-webdriver/chrome'), firefox = require('selenium-webdriver/firefox'), by = require('selenium-webdriver/lib/by'); const By=by.By; const utils=require('../utils/Utils.js'); const Utils=utils.Utils; const wizardStep3=require("./WizardStep3.js"); var COUNT_TIERS; const itemsRemove=By.className("item-remove"); const buttonAdd=By.className("button button_fill button_fill_plus"); const WhitelistContainer=By.className("white-list-item-container-inner"); const buttonYesAlert=By.className("swal2-confirm swal2-styled"); class TierPage extends page.Page { constructor(driver,tier){ super(driver); this.URL; this.tier=tier; COUNT_TIERS=wizardStep3.WizardStep3.getCountTiers(); this.number=COUNT_TIERS++; wizardStep3.WizardStep3.setCountTiers(COUNT_TIERS); this.name="Tier #"+this.number+": "; this.fieldNameTier; this.fieldStartTimeTier; this.fieldEndTimeTier; this.fieldRateTier; this.fieldSupplyTier; this.fieldWhAddressTier; this.fieldMinTier; this.fieldMaxTier; this.checkboxModifyOn; this.checkboxModifyOff; this.itemsRemove=[]; this.warningName; this.warningStartTime; this.warningEndTime; this.warningRate; this.warningSupply; this.warningRate; this.warningWhAddress; this.warningWhMin; this.warningWhMax; } async initWarnings(){ try { logger.info(this.name + " :init warnings:"); const locator = By.xpath("//p[@style='color: red; font-weight: bold; font-size: 12px; width: 100%; height: 10px;']"); var arr = await super.findWithWait(locator); let ci_tresh=2; let ci_mult=5; if (wizardStep3.WizardStep3.getFlagCustom()) ci_tresh=3; if (wizardStep3.WizardStep3.getFlagWHitelising()) ci_mult=8; this.warningName = arr[ci_tresh+(this.number)*ci_mult]; this.warningStartTime=arr[ci_tresh+(this.number)*ci_mult+1]; this.warningEndTime=arr[ci_tresh+(this.number)*ci_mult+2]; this.warningRate=arr[ci_tresh+(this.number)*ci_mult+3]; this.warningSupply=arr[ci_tresh+(this.number)*ci_mult+4]; this.warningWhAddress=arr[ci_tresh+(this.number)*ci_mult+5]; this.warningWhMin=arr[ci_tresh+(this.number)*ci_mult+6]; this.warningWhMax=arr[ci_tresh+(this.number)*ci_mult+7]; return arr; } catch(err){ logger.info(this.name+": dont contain warning elements"); return null; } } async initItemsRemove(){ var arr = await super.findWithWait(itemsRemove); for (var i=0;i