public void Automation_MO_MailMigrationTest() { string login = RunConfigurator.GetValueByXpath("//metaname[text()='client1']/..//user"); string password = RunConfigurator.GetValueByXpath("//metaname[text()='client1']/..//password"); string client = RunConfigurator.GetValueByXpath("//metaname[text()='client1']/../name"); string projectName = RunConfigurator.GetValueByXpath("//metaname[text()='client1']/..//metaname[text()='project1']/..//name"); string sourceMailbox3 = RunConfigurator.GetValueByXpath("//metaname[text()='client1']/..//metaname[text()='project1']/..//metaname[text()='entry3']/..//source"); try { LoginAndSelectRole(login, password, client); SelectProject(projectName); User.AtProjectOverviewForm().GetUsersCount(); User.AtProjectOverviewForm().OpenUsersList(); User.AtUsersForm().SyncUserByLocator(sourceMailbox3); User.AtUsersForm().ConfirmSync(); User.AtUsersForm().AssertUserHaveSyncingState(sourceMailbox3); User.AtUsersForm().OpenDetailsByLocator(sourceMailbox3); User.AtUsersForm().VerifyStateIS("Syncing"); User.AtUsersForm().WaitForJobIsCreated(); User.AtUsersForm().AssertDetailsStopButtonIsEnabled(); User.AtUsersForm().WaitForSyncedState(); User.AtUsersForm().DownloadLogs(); RunConfigurator.CheckLogsFileIsDownloaded(); User.AtUsersForm().AssertDetailsSyncButtonIsEnabled(); User.AtUsersForm().CompleteSync(); User.AtUsersForm().ConfirmComplete(); User.AtUsersForm().VerifyStateIS("Complete"); User.AtUsersForm().CloseUserDetails(); } catch (Exception e) { LogHtml(Browser.GetDriver().PageSource); throw e; } }
public override void Run() { var username = RunConfigurator.GetValueByXpath($"//metaname[text()='{clientName}']/..//user"); var password = RunConfigurator.GetValueByXpath($"//metaname[text()='{clientName}']/..//password"); var project = RunConfigurator.GetValueByXpath($"//metaname[text()='{clientName}']/..//metaname[text()='{projectName}']/..//name"); var syncUsername = RunConfigurator.GetValueByXpath($"//metaname[text()='{clientName}']/..//metaname[text()='{projectName}']/..//metaname[text()='entry1']/..//source"); try { LogIn(username, password); SelectProject(project); } catch (Exception e) { InsertDataToSql(DateTime.UtcNow, "Error during login and reload file"); throw e; } try { User.AtProjectOverviewForm().OpenUsersList(); } catch (Exception e) { InsertDataToSql(DateTime.UtcNow, "Error navigating to user migration form"); throw e; } try { User.AtUsersForm().SyncUserByLocator(syncUsername); User.AtUsersForm().ConfirmSync(); User.AtUsersForm().AssertUserHaveSyncingState(syncUsername); } catch (Exception e) { InsertDataToSql(DateTime.UtcNow, "Error selecting mailbox and syncing it"); throw e; } try { User.AtUsersForm().WaitForState(syncUsername, State.Synced, 30000); } catch (Exception e) { InsertDataToSql(DateTime.UtcNow, "Sync error"); throw e; } try { User.AtUsersForm().OpenDetailsByLocator(syncUsername); User.AtUsersForm().SortStartedJobs(); User.AtUsersForm().WaitForJobSortedByTime(); User.AtUsersForm().DownloadLogs(); RunConfigurator.CheckLogsFileIsDownloaded(); } catch (Exception e) { InsertDataToSql(DateTime.UtcNow, "Log downloading error"); throw e; } InsertDataToSql(DateTime.UtcNow); }