Exemple #1
0
        public void StepThroughWizard()
        {
            // Arrange
            var workflow = new WizardWorkflow(namePage);

            // Act
            FinishedPage finishedPage = workflow.StepThrough();

            // Assert
            Assert.IsTrue(finishedPage.CongratulationsExists);
        }
Exemple #2
0
        public void StepThroughWizard()
        {
            using (var finishedWebPage = new TempWebPage(Finished))
                using (var addressWebPage = new TempWebPage(string.Format(Address, Path.GetFileName(finishedWebPage.FilePath))))
                    using (var nameWebPage = new TempWebPage(string.Format(Name, Path.GetFileName(addressWebPage.FilePath))))
                    {
                        // Arrange
                        var namePage = Page.Launch <NamePage>(nameWebPage.FilePath);
                        var workflow = new WizardWorkflow(namePage);

                        // Act
                        FinishedPage finishedPage = workflow.StepThrough();

                        // Assert
                        Assert.IsTrue(finishedPage.CongratulationsExists);
                    }
        }
        public void Purchase()
        {
            FinishedPage finishedPage = new FinishedPage(browserDriver);

            Assert.That(finishedPage.CheckoutCompletedExist, Is.True);
        }
Exemple #4
0
        public static void Main(String[] args)
        {
            try {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                InstallerResources.CurrentLanguageChanged += new EventHandler(InstallerResources_CurrentLanguageChanged);

                InstallationInfo.ProgramMode = ProgramMode.None;

                #region Initial PackageInfo Options

                // set this here because there's nowhere else to put it
                // HACK: Devise a shortlist of known languages that have this problem
                // also, does this affect Vista?
                if (Environment.OSVersion.Version.Major == 5)
                {
                    PackageInfo.LiteMode = System.Globalization.CultureInfo.InstalledUICulture.DisplayName.IndexOf("English", StringComparison.OrdinalIgnoreCase) == -1;
                }

                if (InstallerResources.IsCustomized)
                {
                    PackageInfo.IgnoreCondition = InstallerResources.CustomizedSettings.DisablePackageCheck;
                }

                PackageInfo.SystemRestore = true;

                InstallationInfo.FeedbackSend = true;

                #endregion

                if (args.Length > 0)
                {
                    //////////////////////////////////////////
                    // Pause
                    if (args.IndexOf("/pause") > -1)
                    {
                        MessageBox.Show("Paused", "Anolis Installer", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    }

                    //////////////////////////////////////////
                    // Package Condition
                    if (args.IndexOf("/ignoreCondition") > -1)
                    {
                        PackageInfo.IgnoreCondition = true;
                    }

                    //////////////////////////////////////////
                    // Uninstall Mode
                    String uninstall = GetUninstallation(args);
                    if (uninstall != null)
                    {
                        InstallationInfo.UninstallPackage = new FileInfo(uninstall);
                        InstallationInfo.ProgramMode      = ProgramMode.UninstallPackage;
                    }

                    //////////////////////////////////////////
                    // Jump-to-Package
//
//					String filename = args[0];
//					if( File.Exists( filename ) ) {
//
//						String ext = Path.GetExtension( filename ).ToUpperInvariant();
//						if(ext == ".ANOP") { // package archive
//
//						} else if( ext == ".XML") { // package definition
//
//						}
//
//					}
                }



                // preload resources
                System.Drawing.Image
                    image = InstallerResources.GetImage("Background");
                image = InstallerResources.GetImage("Banner");

                // Set up the wizard

                // create the pages
                PageAWelcome    = new WelcomePage();
                PageBMainAction = new MainActionPage();

                PageCASelectPackage  = new SelectPackagePage();
                PageCBExtracting     = new ExtractingPage();
                PageCCUpdatePackage  = new UpdatePackagePage();
                PageCDReleaseNotes   = new ReleaseNotesPage();
                PageCE1Selector      = new SelectorPage();
                PageCE2ModifyPackage = new ModifyPackagePage();
                PageCFInstallOpts    = new InstallationOptionsPage();
                PageCFInstallOptForm = new InstallationOptionsForm();
                PageCGInstalling     = new InstallingPage();

                PageDADestination = new DestinationPage();
                PageDBDownloading = new DownloadingPage();

                PageEASelectBackup = new SelectBackupPage();

                PageFFinished = new FinishedPage();

                WizardForm = InstallationInfo.CreateWizard();

                WizardForm.CancelClicked += new EventHandler(wiz_CancelClicked);
                WizardForm.HasHelp        = false;
                WizardForm.Title          = InstallationInfo.InstallerTitle;
                WizardForm.Icon           = InstallerResources.GetIcon("Package");

                WizardForm.NextText   = InstallerResources.GetString("Wiz_Next");
                WizardForm.BackText   = InstallerResources.GetString("Wiz_Prev");
                WizardForm.CancelText = InstallerResources.GetString("Wiz_Cancel");

                InstallerResources.ForceLocalize();
            } catch (Exception ex) {
                StringBuilder sb = new StringBuilder();
                while (ex != null)
                {
                    sb.Append(ex.Message);
                    sb.Append("\r\n");
                    sb.Append(ex.StackTrace);

                    if (ex.InnerException != null)
                    {
                        sb.Append("\r\n\r\n");
                    }

                    ex = ex.InnerException;
                }

                MessageBox.Show(sb.ToString(), "Anolis Installer - Initialisation Exception", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                return;
            }

            switch (InstallationInfo.ProgramMode)
            {
            case ProgramMode.UninstallPackage:
                WizardForm.LoadPage(PageEASelectBackup);
                break;

            case ProgramMode.None:
            default:
                WizardForm.LoadPage(PageAWelcome);
                break;
            }

            WizardForm.Run();


            // Clean-up
            if (PackageInfo.Package != null && (PackageInfo.Source == PackageSource.Embedded || PackageInfo.Source == PackageSource.Archive))
            {
                PackageInfo.Package.DeleteFiles();
            }
        }