<commit_before>import _ from 'lodash';
import {
  navigateTo,
  waitUntilUrlEquals,
} from '../support/helpers/route-helpers'

export default function () {
  this.Given(/^I am on the General Settings "([^"]*)" screen$/, async function (screen) {
    await navigateTo.call(this, `/settings/${screen}`);
  });

  this.When(/^I click on secondary menu (.*) item$/, async function (buttonName) {
    const buttonSelector = `.SettingsMenuItem_component.${_.camelCase(buttonName)}`;
    await this.client.waitForVisible(buttonSelector);
    await this.client.click(buttonSelector);
  });

  this.When(/^I select second theme$/, async function () {
    await this.client.click(".DisplaySettings_themesWrapper > button:nth-child(2)");
  });

  this.When(/^I toggle switch to disable send-logs$/, async function () {
    await this.client.waitForVisible('.SupportSettings_component .SimpleSwitch_switch');
    await this.client.click('.SupportSettings_component .SimpleSwitch_checked');
  });

  this.When(/^I open General Settings language selection dropdown$/, async function () {
    await this.client.click('.GeneralSettings_component .SimpleInput_input');
  });

  this.Then(/^I should see General Settings "([^"]*)" screen$/, async function (screenName) {
    return waitUntilUrlEquals.call(this, `/settings/${screenName}`);
  });

  this.Then(/^I should see Japanese language as selected$/, async function () {
    return this.client.waitUntil(async () => {
      const selectedLanguage = await this.client.getText('.GeneralSettings_component .SimpleInput_input');
      return selectedLanguage === selectedLanguage;
    });
  });

  this.Then(/^I should see second theme as selected$/, async function () {<commit_msg>[DAEF-456] Fix general settings select-language feature acceptance test<commit_after>import _ from 'lodash';
import {
  navigateTo,
  waitUntilUrlEquals,
} from '../support/helpers/route-helpers'

export default function () {
  this.Given(/^I am on the General Settings "([^"]*)" screen$/, async function (screen) {
    await navigateTo.call(this, `/settings/${screen}`);
  });

  this.When(/^I click on secondary menu (.*) item$/, async function (buttonName) {
    const buttonSelector = `.SettingsMenuItem_component.${_.camelCase(buttonName)}`;
    await this.client.waitForVisible(buttonSelector);
    await this.client.click(buttonSelector);
  });

  this.When(/^I select second theme$/, async function () {
    await this.client.click('.DisplaySettings_themesWrapper > button:nth-child(2)');
  });

  this.When(/^I toggle switch to disable send-logs$/, async function () {
    await this.client.waitForVisible('.SupportSettings_component .SimpleSwitch_switch');
    await this.client.click('.SupportSettings_component .SimpleSwitch_checked');
  });

  this.When(/^I open General Settings language selection dropdown$/, async function () {
    await this.client.click('.GeneralSettings_component .SimpleInput_input');
  });

  this.Then(/^I should see General Settings "([^"]*)" screen$/, async function (screenName) {
    return waitUntilUrlEquals.call(this, `/settings/${screenName}`);
  });

  this.Then(/^I should see Japanese language as selected$/, async function () {
    return this.client.waitUntil(async () => {
      const selectedLanguage = await this.client.getValue('.GeneralSettings_component .SimpleInput_input');
      const expectedLanguage = await this.intl('global.language.japanese');
      return selectedLanguage === expectedLanguage;
    });
  });

  this.Then(/^I should see second theme as selected$/, async function () {
{'fraction_non_alphanumeric': 0.1471825063078217, 'fraction_numerical': 0.0014017381553125877, 'mean_word_length': 4.45565749235474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7540', 'n_tokens_mistral': 996, 'n_tokens_neox': 993, 'n_words': 241}