public void TestInitialize()
        {
            this.folderPath    = "C:/Temp";
            this.debugFileName = "test.zip";
            this.logFileName   = "test.txt";
            if (!Directory.Exists(this.folderPath))
            {
                Directory.CreateDirectory(this.folderPath);
            }

            // check the file exists or not. If already existed then delete it.
            foreach (string fileName in new List <string> {
                this.debugFileName, this.logFileName
            })
            {
                string fullPath = Path.Combine(this.folderPath, fileName);
                if (File.Exists(fullPath))
                {
                    File.Delete(fullPath);
                }
            }

            this.browser   = new BrowserSession();
            this.vpnClient = new FirefoxPrivateVPNSession();
            this.desktop   = new DesktopSession();
            Utils.RearrangeWindows(this.vpnClient, this.browser);
        }
Beispiel #2
0
 public void TestInitialize()
 {
     this.browser   = new BrowserSession();
     this.vpnClient = new FirefoxPrivateVPNSession();
     this.desktop   = new DesktopSession();
     Utils.RearrangeWindows(this.vpnClient, this.browser);
 }
        public void TestInitialize()
        {
            this.folderPath    = "C:/Temp";
            this.debugFileName = "test.zip";
            this.logFileName   = "test.txt";
            if (!Directory.Exists(this.folderPath))
            {
                Directory.CreateDirectory(this.folderPath);
            }

            // check the file exists or not. If already existed then delete it.
            foreach (string fileName in new List <string> {
                this.debugFileName, this.logFileName
            })
            {
                string fullPath = Path.Combine(this.folderPath, fileName);
                if (File.Exists(fullPath))
                {
                    File.Delete(fullPath);
                }
            }

            this.browser   = new BrowserSession();
            this.vpnClient = new FirefoxPrivateVPNSession();
            this.desktop   = new DesktopSession();

            // Resize browser to make vpn client and browser are not overlapped
            var vpnClientPosition = this.vpnClient.Session.Manage().Window.Position;
            var vpnClientSize     = this.vpnClient.Session.Manage().Window.Size;

            this.browser.SetWindowPosition(vpnClientPosition.X + vpnClientSize.Width, 0);
        }
Beispiel #4
0
        /// <summary>
        /// User click the toggle switch to connect to VPN.
        /// </summary>
        /// <param name="vpnClient">VPN session.</param>
        /// <param name="desktop">Desktop session.</param>
        public static void ConnectVPN(FirefoxPrivateVPNSession vpnClient, DesktopSession desktop)
        {
            // Click VPN switch toggle and turn on VPN
            vpnClient.Session.SwitchTo();
            MainScreen mainScreen = new MainScreen(vpnClient.Session);

            Assert.AreEqual("VPN is off", mainScreen.GetTitle());
            Assert.AreEqual("Turn it on to protect your entire device", mainScreen.GetSubtitle());
            Assert.IsTrue(mainScreen.GetOffImage().Displayed);
            Assert.IsFalse(mainScreen.GetOnImage().Displayed);
            mainScreen.ToggleVPNSwitch();

            // Verify the windows notification
            desktop.Session.SwitchTo();
            WindowsNotificationScreen windowsNotificationScreen = new WindowsNotificationScreen(desktop.Session);

            Assert.AreEqual("VPN is on", windowsNotificationScreen.GetTitleText());
            Assert.AreEqual("You're secure and protected.", windowsNotificationScreen.GetMessageText());
            windowsNotificationScreen.ClickDismissButton();

            // Verify user is connected to Mullvad VPN
            IRestResponse response = Utils.AmIMullvad("You are connected to Mullvad");

            Console.WriteLine($"After connection - Mullvad connected API response: {response.Content}");
            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.IsTrue(response.Content.Contains("You are connected to Mullvad"));

            // Verify the changes on main screen
            vpnClient.Session.SwitchTo();
            Assert.IsTrue(mainScreen.GetOnImage().Displayed);
            Assert.IsFalse(mainScreen.GetOffImage().Displayed);
            Assert.AreEqual("VPN is on", mainScreen.GetTitle());
            Assert.IsTrue(mainScreen.GetSubtitle().Contains("Secure and protected"));
        }
Beispiel #5
0
        /// <summary>
        /// The user sign in steps.
        /// </summary>
        /// <param name="vpnClient">VPN session.</param>
        /// <param name="browser">Browser session.</param>
        public static void UserSignIn(FirefoxPrivateVPNSession vpnClient, BrowserSession browser)
        {
            // Verify Account Screen
            vpnClient.Session.SwitchTo();
            VerifyAccountScreen verifyAccountScreen = new VerifyAccountScreen(vpnClient.Session);

            Assert.AreEqual("Waiting for sign in and subscription confirmation...", verifyAccountScreen.GetTitle());
            Assert.AreEqual("Cancel and try again", verifyAccountScreen.GetCancelTryAgainButtonText());

            // Switch to Browser session
            browser.Session.SwitchTo();

            // Email Input page
            EmailInputPage emailInputPage = new EmailInputPage(browser.Session);

            emailInputPage.InputEmail(Environment.GetEnvironmentVariable("EXISTED_USER_NAME"));
            emailInputPage.ClickContinueButton();

            // Password Input Page
            PasswordInputPage passwordInputPage = new PasswordInputPage(browser.Session);

            passwordInputPage.InputPassword(Environment.GetEnvironmentVariable("EXISTED_USER_PASSWORD"));
            passwordInputPage.ClickSignInButton();

            // Quick Access Screen
            vpnClient.Session.SwitchTo();
            QuickAccessScreen quickAccessScreen = new QuickAccessScreen(vpnClient.Session);

            Assert.AreEqual("Quick access", quickAccessScreen.GetTitle());
            Assert.AreEqual("You can quickly access Mozilla VPN from your taskbar tray", quickAccessScreen.GetSubTitle());
            Assert.AreEqual("Located next to the clock at the bottom right of your screen", quickAccessScreen.GetDescription());
            quickAccessScreen.ClickContinueButton();
        }
Beispiel #6
0
        public void TestInitialize()
        {
            this.browser   = new BrowserSession();
            this.vpnClient = new FirefoxPrivateVPNSession();
            Utils.RearrangeWindows(this.vpnClient, this.browser);

            // Delete email from restmail.net
            Assert.IsTrue(Utils.DeleteUserFromRestMail(Constants.NewUserName));
        }
Beispiel #7
0
        public void TestInitialize()
        {
            this.browser   = new BrowserSession();
            this.vpnClient = new FirefoxPrivateVPNSession();

            // Resize browser to make vpn client and browser are not overlapped
            var vpnClientPosition = this.vpnClient.Session.Manage().Window.Position;
            var vpnClientSize     = this.vpnClient.Session.Manage().Window.Size;

            this.browser.SetWindowPosition(vpnClientPosition.X + vpnClientSize.Width, 0);
        }
        public void TestInitialize()
        {
            this.browser   = new BrowserSession();
            this.vpnClient = new FirefoxPrivateVPNSession();

            // Resize browser to make vpn client and browser are not overlapped
            var vpnClientPosition = this.vpnClient.Session.Manage().Window.Position;
            var vpnClientSize     = this.vpnClient.Session.Manage().Window.Size;

            this.browser.SetWindowPosition(vpnClientPosition.X + vpnClientSize.Width, 0);

            // Delete email from restmail.net
            Assert.IsTrue(Utils.DeleteUserFromRestMail(Constants.NewUserName));
        }
Beispiel #9
0
        /// <summary>
        /// The user sign out steps.
        /// </summary>
        /// <param name="vpnClient">VPN session.</param>
        public static void UserSignOut(FirefoxPrivateVPNSession vpnClient)
        {
            vpnClient.Session.SwitchTo();
            MainScreen mainScreen = new MainScreen(vpnClient.Session);

            if (mainScreen.GetOnImage().Displayed)
            {
                mainScreen.ToggleVPNSwitch();
            }

            mainScreen.ClickSettingsButton();
            SettingScreen settingScreen = new SettingScreen(vpnClient.Session);

            Assert.AreEqual("Settings", settingScreen.GetTitle());
            settingScreen.ScrollDown();
            settingScreen.ClickSignOutButton();
        }
 public void TestInitialize()
 {
     this.vpnClient = new FirefoxPrivateVPNSession();
 }