<commit_before>const { startBrowser } = require('../functions');

const css = 'css selector';
const privKey =
  '0x0077ce8e3d12432dc73e87943fe1e992db90964fbb6e8ae9f97a7163585c6019';
const address = '0x9ccCb2B82f8F607db3F5D50BF4083665c3002f83';
module.exports = {
  before: function (browser) {
    browser.globals.waitForConditionTimeout = 15000;
  },
  'Access Private Wallet test': async browser => {
    // open browser
    startBrowser(browser);
    browser
      .waitForElementVisible(css, '.HomeAccessWallet')
      .click(css, '.HomeAccessWallet');

    // remove footer
    browser.click(css, '.HideWalletBanner');

    // select software type wallet
    browser
      .moveToElement('.AccessSoftwareWallet', 10, 10)
      .waitForElementVisible('.AccessSoftwareWallet', 500)
      .click(css, '.AccessSoftwareWallet')
      .assert.urlContains('/software');

    // select private key
    browser
      .waitForElementVisible(css, '.AccessPrivateKeyWallet')
      .click(css, '.AccessPrivateKeyWallet');

    // input private key
    browser.assert
      .urlContains('private-key')
      .waitForElementVisible(css, '.PrivateKeyInput')
      .click(css, '.PrivateKeyInput')
      .keys(privKey)
      .click(css, '.PrivateKeyTerms > div')
      .click(css, '.PrivateKeyAccess')
      .assert.urlContains('dashboard');

    // open balance card
    browser
      .moveTo(null, 500, 0)
      .mouseButtonClick()
      .waitForElementVisible(css, '.BalanceCardQR')
      .click(css, '.BalanceCardQR');

    // check if address is the expected address
    browser
      .waitForElementVisible(css, '.BalanceCardAddress')
      .expect.element('.BalanceCardAddress')
      .text.to.equal(address);
  }
};<commit_msg>devop: 🔧 swap crosschain test<commit_after>const { startBrowser } = require('../functions');

const css = 'css selector';
const address = 'bc1qludar9az7epe3rrazdh470e326eum9shchzcc8';
const privKey =
  '0x0077ce8e3d12432dc73e87943fe1e992db90964fbb6e8ae9f97a7163585c6019';
const amount = '0.1';
const coin = 'BTC';

module.exports = {
  before: function (browser) {
    browser.globals.waitForConditionTimeout = 15000;
  },
  'Swap Crosschain test': async browser => {
    // open browser
    startBrowser(browser);
    browser.maximizeWindow();

    // click access wallet
    browser
      .waitForElementVisible(css, '.HomeAccessWallet')
      .click(css, '.HomeAccessWallet');

    // select software type wallet
    browser
      .moveToElement('.AccessWalletSoftwareButton', 10, 10)
      .waitForElementVisible('.AccessWalletSoftwareButton', 500)
      .click(css, '.AccessWalletSoftwareButton')
      .assert.urlContains('/software');

    // select private key
    browser
      .waitForElementVisible(css, '.AccessPrivateKeyWallet')
      .click(css, '.AccessPrivateKeyWallet');

    // input private key
    browser.assert
      .urlContains('private-key')
      .waitForElementVisible(css, '.PrivateKeyInput')
      .click(css, '.PrivateKeyInput')
      .sendKeys(css, '.v-text-field__slot > input', privKey)
      .click(css, '.PrivateKeyTerms > div')
      .click(css, '.PrivateKeyAccess')
      .assert.urlContains('dashboard');

    // click swap button
    browser.waitForElementVisible(css, '.SwapButton').click(css, '.SwapButton');

    // select to token
    browser.assert
      .urlContains('swap')
      .waitForElementVisible(css, '.BalanceLabel')
      // .ensure.elementTextIs('div span', 'Select Token')
      .click(css, '.ToTokenSelect')
      .waitForElementVisible(css, '.mew-select-search')
      .click(css, '.mew-select-search')
      .sendKeys(css, 'input:focus', coin)
      .click(css, 'img[alt=BTC]')
      .click(css, '.SwitchTokens');

    // input from amount
    browser.click(css, '.FromAmountInput').sendKeys(css, 'input:focus', amount);

    // input address
    browser
      .click(css, '.FromAddressInput')
      .sendKeys(css, 'input:focus', address);

    // click swap when enabled
    browser
      .waitForElementVisible(css, '.NextButton')
      .ensure.elementIsEnabled('.NextButton')
      .click(css, '.NextButton');
  }
};
{'fraction_non_alphanumeric': 0.13777127529870764, 'fraction_numerical': 0.038039502560351136, 'mean_word_length': 3.2952879581151833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '918451', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1274, 'n_words': 239}