<commit_before>﻿using System;
using NUnit.Framework;
using OpenQA.Selenium;

namespace Atata.Tests
{
    public class PageObjectTests : UITestFixture
    {
        [Test]
        public void PageObject_RefreshPage()
        {
            Go.To<BasicControlsPage>().
                ById.FirstName.Set("test").
                ById.FirstName.Should.Equal("test").
                RefreshPage().
                ById.FirstName.Should.BeNull();
        }

        [Test]
        public void PageObject_RefreshPageUntil()
        {
            Go.To<WaitingPage>().
                CurrentTime.Get(out TimeSpan? time).
                RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 20, retryInterval: 2);
        }

        [Test]
        public void PageObject_RefreshPageUntil_Timeout()
        {
            var page = Go.To<WaitingPage>().
                CurrentTime.Get(out TimeSpan? time);

            using (StopwatchAsserter.Within(2))
                Assert.Throws<TimeoutException>(() =>
                    page.RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 1));
        }

        [Test]
        public void PageObject_IgnoreInit()
        {
            Assert.That(Go.To<BasicControlsPage>().IgnoredInput, Is.Null);
        }

        [Test]
        public void PageObject_GoBack()
        {
            Go.To<GoTo1Page>().
                GoTo2().
                    GoBack<GoTo1Page>().
                    Should.Exist();
        }

        [Test]
        public void PageObject_GoBack_Fail()
        {
            var page2 = Go.To<GoTo1Page>().
                GoTo2();

            Assert.Throws<AssertionException>(
                () => page2.GoBack<GoTo3Page>());
        }<commit_msg>Fix PageObject_RefreshPageUntil_Timeout test<commit_after>﻿using System;
using NUnit.Framework;
using OpenQA.Selenium;

namespace Atata.Tests
{
    public class PageObjectTests : UITestFixture
    {
        [Test]
        public void PageObject_RefreshPage()
        {
            Go.To<BasicControlsPage>().
                ById.FirstName.Set("test").
                ById.FirstName.Should.Equal("test").
                RefreshPage().
                ById.FirstName.Should.BeNull();
        }

        [Test]
        public void PageObject_RefreshPageUntil()
        {
            Go.To<WaitingPage>().
                CurrentTime.Get(out TimeSpan? time).
                RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 20, retryInterval: 2);
        }

        [Test]
        public void PageObject_RefreshPageUntil_Timeout()
        {
            var page = Go.To<WaitingPage>().
                CurrentTime.Get(out TimeSpan? time);

            using (StopwatchAsserter.Within(1, 1))
                Assert.Throws<TimeoutException>(() =>
                    page.RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 1));
        }

        [Test]
        public void PageObject_IgnoreInit()
        {
            Assert.That(Go.To<BasicControlsPage>().IgnoredInput, Is.Null);
        }

        [Test]
        public void PageObject_GoBack()
        {
            Go.To<GoTo1Page>().
                GoTo2().
                    GoBack<GoTo1Page>().
                    Should.Exist();
        }

        [Test]
        public void PageObject_GoBack_Fail()
        {
            var page2 = Go.To<GoTo1Page>().
                GoTo2();

            Assert.Throws<AssertionException>(
                () => page2.GoBack<GoTo3Page>());
        }
{'fraction_non_alphanumeric': 0.11456043956043956, 'fraction_numerical': 0.009615384615384616, 'mean_word_length': 1.6307803468208093, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 35, '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': '3933320', 'n_tokens_mistral': 1071, 'n_tokens_neox': 998, 'n_words': 159}