예제 #1
0
        public virtual void TearDown()
        {
            try
            {
                bool testError = TestContext.CurrentContext.Outcome.Status ==
                                 TestStatus.Failed;
                bool serverError = ie.ContainsText("Server Error");

                if (testError || serverError)
                {
                    Snapshot("Test Failed on this page", ExecutionSteps.Log);
                    Assert.IsFalse(serverError,
                                   "An error left the system in a failing state.\n" +
                                   ErrorContext());
                }
                LogoutIfLoggedIn();
                ie.GoTo("about:blank");
            }
            finally
            {
                IEFactory.Release(ie);
                ie = null;
                Thread.SetData(DATA_SLOT, null);
            }
        }
예제 #2
0
        public virtual void Setup()
        {
            try
            {
                ie = IEFactory.GetInternetExplorer();                 // new SmartIE(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                ExecutionSteps.Log.WriteException(e);
                if (ie != null)
                {
                    IEFactory.Release(ie);
                }
                throw;
            }

            Thread.SetData(DATA_SLOT, this);

            LoadSite();

            if (AutoLogin)
            {
                LogoutIfLoggedIn();
                LoginAs(UserName, Password);
            }
        }
예제 #3
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                if ((this._parent.EFactoryInstance == null))
                {
                    IEFactory eFactoryInstanceCasted = item.As <IEFactory>();
                    if ((eFactoryInstanceCasted != null))
                    {
                        this._parent.EFactoryInstance = eFactoryInstanceCasted;
                        return;
                    }
                }
                IEClassifier eClassifiersCasted = item.As <IEClassifier>();

                if ((eClassifiersCasted != null))
                {
                    this._parent.EClassifiers.Add(eClassifiersCasted);
                }
                IEPackage eSubpackagesCasted = item.As <IEPackage>();

                if ((eSubpackagesCasted != null))
                {
                    this._parent.ESubpackages.Add(eSubpackagesCasted);
                }
                if ((this._parent.ESuperPackage == null))
                {
                    IEPackage eSuperPackageCasted = item.As <IEPackage>();
                    if ((eSuperPackageCasted != null))
                    {
                        this._parent.ESuperPackage = eSuperPackageCasted;
                        return;
                    }
                }
            }