<commit_before>import {getBrowser} from '../mini-testium-mocha';
import assert from 'assertive';

describe('window api', () => {
  let browser;
  before(async () => (browser = await getBrowser()));

  describe('frames', () => {
    before(() => {
      browser.navigateTo('/windows.html');
      browser.assert.httpStatus(200);
    });

    it('can be switched', () => {
      browser.switchToFrame('cool-frame');
      const iframeContent = browser.getElement('.in-iframe-only').get('text');
      browser.switchToDefaultFrame();
      const primaryContent = browser.getElement('.in-iframe-only');
      assert.equal('iframe content!', iframeContent);
      assert.equal(null, primaryContent);
    });

    it('can be found when nested', () => {
      browser.switchToFrame('cool-frame');
      browser.switchToFrame('nested-frame');<commit_msg>Fix tests to fail as they should<commit_after>import {getBrowser} from '../mini-testium-mocha';
import assert from 'assertive';

describe('window api', () => {
  let browser;
  before(async () => (browser = await getBrowser()));

  describe('frames', () => {
    before(() => {
      browser.navigateTo('/windows.html');
      browser.assert.httpStatus(200);
    });

    it('can be switched', () => {
      browser.switchToFrame('cool-frame');
      const iframeContent = browser.getElement('.in-iframe-only').get('text');
      browser.switchToDefaultFrame();
      const primaryContent = browser.getElement('.in-iframe-only');
      assert.equal('iframe content!', iframeContent);
      assert.equal(null, primaryContent);
    });

    it('fails with invalid frame', () => {
      assert.throws(() =>
        browser.switchToFrame('invalid-frame'));
    });

    it('can be found when nested', () => {
      browser.switchToFrame('cool-frame');
      const outsideElement = browser.getElement('#nested-frame-div');
      assert.equal(null, outsideElement);

      browser.switchToFrame('nested-frame');
{'fraction_non_alphanumeric': 0.1778575089697591, 'fraction_numerical': 0.0030753459764223477, 'mean_word_length': 3.55011655011655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4716374', 'n_tokens_mistral': 571, 'n_tokens_neox': 538, 'n_words': 102}