<commit_before>﻿using System;
using System.IO;
using OpenQA.Selenium;

namespace ExtjsWd.js
{
    public static class JSCommands
    {
        public static void ClickUsingJavascript(int x, int y)
        {
            EvalJS("document.elementFromPoint(" + x + "," + y + ").click();");
        }

        public static void CloseAllMessageBoxes()
        {
            const string closeMsgBoxesViaExtjs = @"Ext.Msg.close();";
            ScenarioFixture.Instance.EvalJS(closeMsgBoxesViaExtjs);
        }

        public static void CloseAllNotifications()
        {
            EvalJS("Ext.ux.desktop.MessageFactory.hideAll();");
        }

        public static void CloseAllWindows()
        {<commit_msg>Try catch for closing message boxes (because any errors will result in failing tests, and this one seems to error when no messagebox is available)<commit_after>﻿using System;
using System.IO;
using OpenQA.Selenium;

namespace ExtjsWd.js
{
    public static class JSCommands
    {
        public static void ClickUsingJavascript(int x, int y)
        {
            EvalJS("document.elementFromPoint(" + x + "," + y + ").click();");
        }

        public static void CloseAllMessageBoxes()
        {
            const string closeMsgBoxesViaExtjs = @"try { 
Ext.Msg.close(); 
} catch { }";
            ScenarioFixture.Instance.EvalJS(closeMsgBoxesViaExtjs);
        }

        public static void CloseAllNotifications()
        {
            EvalJS("Ext.ux.desktop.MessageFactory.hideAll();");
        }

        public static void CloseAllWindows()
        {
{'fraction_non_alphanumeric': 0.10133843212237094, 'fraction_numerical': 0.0, 'mean_word_length': 2.3763440860215055, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1039058', 'n_tokens_mistral': 449, 'n_tokens_neox': 435, 'n_words': 108}