Esempio n. 1
0
        public void TestDevice()
        {
            // Switch to VPN client session
            this.vpnClient.Session.SwitchTo();
            LandingScreen landingScreen = new LandingScreen(this.vpnClient.Session);

            landingScreen.ClickGetStartedButton();

            // User Sign In via web browser
            UserCommonOperation.UserSignIn(this.vpnClient, this.browser);

            // Main Screen
            this.vpnClient.Session.SwitchTo();
            MainScreen mainScreen = new MainScreen(this.vpnClient.Session);

            mainScreen.ClickDeviceListButton();

            // Device Screen
            DeviceScreen deviceScreen = new DeviceScreen(this.vpnClient.Session);

            Assert.AreEqual("My devices", deviceScreen.GetTitle());
            Regex rgx = new Regex(@"^[1-5] of 5$");

            Assert.IsTrue(rgx.IsMatch(deviceScreen.GetDeviceSummary()));
            rgx = new Regex(@"^Devices with Mozilla VPN installed using your account. Connect up to [0-9] devices.$");
            Assert.IsTrue(rgx.IsMatch(deviceScreen.GetDevicePanelTitle()));
            Assert.IsTrue(deviceScreen.GetCurrentDeviceName().Contains(Environment.MachineName));
            Assert.AreEqual("Current device", deviceScreen.GetCurrentDeviceStatus());
            Assert.IsFalse(deviceScreen.GetCurrentDeviceRemoveButton().Displayed);

            // Try to remove one device if there are some other devices.
            deviceScreen.RandomDeleteOneDevice(this.desktop.Session);

            // Back to main screen
            this.vpnClient.Session.SwitchTo();
            deviceScreen.ClickBackButton();

            // Sign out
            UserCommonOperation.UserSignOut(this.vpnClient);
        }