public static void ClassCleanup()
 {
     if (ExhibitHelper.IsExhibitFound(_newExhibit))
     {
         ExhibitHelper.DeleteExhibitByJavascript(_newExhibit);
     }
 }
        public void ProcessExhibit()
        {
            var exhibitHelper = new ExhibitHelper();

            switch (FeatureContext.Current.FeatureInfo.Title)
            {
            case ForensicFeatureName:
            {
                exhibitHelper.ProcessExhibit(_exhibitId, _mediaId, AcquisitionFormatType.ForensicImage);
                break;
            }

            case UfedFeatureName:
            {
                exhibitHelper.ProcessExhibit(_exhibitId, _mediaId, AcquisitionFormatType.MobileDeviceUfed);
                break;
            }

            case XRYFeatureName:
            {
                exhibitHelper.ProcessExhibit(_exhibitId, _mediaId, AcquisitionFormatType.MobileDeviceXry);
                break;
            }

            default:
                throw new Exception("The exhibit (id=" + _exhibitId + ") processing cannot be done for this unexpected feature with name " + FeatureContext.Current.FeatureInfo.Title);
            }
            CheckMediaAndWorkStatuses();
        }
Пример #3
0
        public void exhibit_should_allow_pdf_content_item_adding()
        {
            Logger.Log("Bug: https://github.com/alterm4nn/ChronoZoom/issues/526", LogType.Debug);
            var contentItemPdf = new ContentItem
            {
                Title       = "ContentItemPdf",
                Caption     = "This is pdf",
                MediaSource = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf",
                MediaType   = "PDF",
                Attribution = "Tests Attribution",
                Uri         = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf"
            };
            var exhibit = new Exhibit
            {
                Title        = "WebdriverExhibitWithContent",
                ContentItems = new Collection <Chronozoom.Entities.ContentItem> {
                    contentItemPdf
                }
            };

            ExhibitHelper.AddExhibitWithContentItem(exhibit);
            _newExhibit = ExhibitHelper.GetNewExhibit();
            Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal");
            for (int i = 0; i < exhibit.ContentItems.Count; i++)
            {
                Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal");
                Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal");
                Assert.AreEqual(contentItemPdf.Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal");
            }
        }
Пример #4
0
        public void exhibit_should_allow_skydrive_content_item_adding()
        {
            var contentDocumentItemSkyDrive = new ContentItem
            {
                Title            = "ContentItemSkyDrive",
                Caption          = "This is skydrive",
                SkyDriveFileType = ContentItem.SkyDriveType.Document,
                Attribution      = "Tests Attribution",
                FileName         = "test document"
            };

            var contentPictureItemSkyDrive = new ContentItem
            {
                Title            = "ContentItemSkyDrive",
                Caption          = "This is skydrive",
                SkyDriveFileType = ContentItem.SkyDriveType.Image,
                Attribution      = "Tests Attribution",
                FileName         = "panda"
            };
            var exhibit = new Exhibit
            {
                Title        = "WebdriverExhibitWithContent",
                ContentItems = new Collection <Chronozoom.Entities.ContentItem> {
                    contentDocumentItemSkyDrive, contentPictureItemSkyDrive
                }
            };

            ExhibitHelper.AddExhibitWithSkyDriveContentItem(exhibit);
            _newExhibit = ExhibitHelper.GetNewExhibit();
            Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal");
            for (int i = 0; i < exhibit.ContentItems.Count; i++)
            {
                Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal");
            }
        }
Пример #5
0
        public void exhibit_should_allow_two_content_items_adding()
        {
            var contentItemImage = new ContentItem
            {
                Title     = "ContentItemImage",
                MediaType = "Image",
                Uri       = "http://i.telegraph.co.uk/multimedia/archive/02429/eleanor_scriven_2429776k.jpg"
            };
            var contentItemMusic = new ContentItem
            {
                Title     = "ContentItemMusic",
                MediaType = "Image",
                Uri       = "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Aeroflot_Airbus_A330_Kustov_edit.jpg/800px-Aeroflot_Airbus_A330_Kustov_edit.jpg"
            };
            var exhibit = new Exhibit
            {
                Title        = "WebdriverExhibitWithContent",
                ContentItems = new Collection <Chronozoom.Entities.ContentItem> {
                    contentItemImage, contentItemMusic
                }
            };

            ExhibitHelper.AddExhibitWithContentItem(exhibit);
            _newExhibit = ExhibitHelper.GetNewExhibit();
            Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal");
            for (int i = 0; i < exhibit.ContentItems.Count; i++)
            {
                Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal");
                Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal");
                Assert.AreEqual(exhibit.ContentItems[i].Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal");
            }
        }
Пример #6
0
        public void exhibit_should_allow_two_content_items_adding()
        {
            var contentItemImage = new ContentItem
            {
                Title     = "ContentItemImage",
                MediaType = "Image",
                Uri       = "http://i.telegraph.co.uk/multimedia/archive/02429/eleanor_scriven_2429776k.jpg"
            };
            var contentItemMusic = new ContentItem
            {
                Title     = "ContentItemMusic",
                MediaType = "Audio",
                Uri       = "http://libsyn.com/media/eslpod/ESLPod900.mp3"
            };
            var exhibit = new Exhibit
            {
                Title        = "WebdriverExhibitWithContent",
                ContentItems = new Collection <Chronozoom.Entities.ContentItem> {
                    contentItemImage, contentItemMusic
                }
            };

            ExhibitHelper.AddExhibitWithContentItem(exhibit);
            _newExhibit = ExhibitHelper.GetNewExhibit();
            Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal");
            for (int i = 0; i < exhibit.ContentItems.Count; i++)
            {
                Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal");
                Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal");
                Assert.AreEqual(exhibit.ContentItems[i].Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal");
            }
        }
Пример #7
0
 public void new_exhibit_should_have_a_correct_url()
 {
     for (int i = 0; i < Exhibit.ContentItems.Count; i++)
     {
         Assert.AreEqual(ExhibitHelper.GetExpectedYouTubeUri(Exhibit.ContentItems[i].Uri), _newExhibit.ContentItems[i].Uri,
                         "Content items Urls are not equal");
     }
 }
 public static void ClassInitialize(TestContext testContext)
 {
     BrowserStateManager.RefreshState();
     HomePageHelper.OpenSandboxPage();
     HomePageHelper.DeleteAllElementsLocally();
     ExhibitHelper.AddExhibitWithContentItem(Exhibit);
     _newExhibit = ExhibitHelper.GetNewExhibit();
 }
        private void ProcessExhibit()
        {
            var exhibitHelper = new ExhibitHelper();

            exhibitHelper.ProcessExhibit(_exhibitId, _mediaId, AcquisitionFormatType.MobileDeviceUfed);

            CheckMediaAndWorkStatuses();
        }
        public static void PrepareDbData(MediaDataModel mediaDataModel, AcquisitionFormatType type)
        {
            mediaDataModel.EvidencePath = Path.GetFullPath(_settings["EvidencePath"].Value);
            var details = new ExhibitHelper().PrepareDbData(mediaDataModel.EvidencePath, type);

            _caseId    = details.CaseId;
            _exhibitId = details.ExhibitId;
            _mediaId   = details.MediaId;
        }
Пример #11
0
        private void ProcessExhibit()
        {
            var exhibitHelper = new ExhibitHelper();

            Console.WriteLine("Acquisition format '" + AcquisitionFormatType.MobileDeviceXry + "' will be processed for ExhibitId :" + _exhibitId);

            exhibitHelper.ProcessExhibit(_exhibitId, _mediaId, AcquisitionFormatType.MobileDeviceXry);

            CheckMediaAndWorkStatuses();
        }
Пример #12
0
 public void TestCleanup()
 {
     if (_newExhibit != null && ExhibitHelper.IsExhibitFound(_newExhibit))
     {
         ExhibitHelper.DeleteExhibitByJavascript(_newExhibit);
     }
     AuthorizationHelper.LogoutByUrl();
     AuthorizationHelper.LogoutFromSkyDrive();
     CreateScreenshotsIfTestFail(TestContext);
 }
        private static void PrepareDbData()
        {
            var details = new ExhibitHelper().PrepareDbData(_mediaDataModel.EvidencePath, AcquisitionFormatType.MobileDeviceUfed);

            _caseId           = details.CaseId;
            _exhibitId        = details.ExhibitId;
            _mediaId          = details.MediaId;
            _casePoliceNumber = details.CasePoliceNumber;
            _eclExhibitNumber = details.EclExhibitNumber;
            _mediaNumber      = details.MediaNumber;
        }
Пример #14
0
        public void Test_Open_Bibliography()
        {
            ExhibitHelper.NavigateToExhibit(_newExhibit);
            Bibliography bibliography         = ExhibitHelper.GetBibliography();
            bool         isBibliographyOpened = ExhibitHelper.IsBibliographyOpened();

            ExhibitHelper.CloseBibliography();
            Assert.IsTrue(isBibliographyOpened, "Bibliography is not opened");
            StringAssert.Contains(bibliography.Sources[0].Name, _newExhibit.ContentItems[0].MediaSource);
            StringAssert.StartsWith(bibliography.Sources[0].Description, _newExhibit.ContentItems[0].Title);
        }
Пример #15
0
 public void TestCleanup()
 {
     if (_newExhibit != null && ExhibitHelper.IsExhibitFound(_newExhibit))
     {
         ExhibitHelper.DeleteExhibitByJavascript(_newExhibit);
     }
     if (_newTimeline != null && TimelineHelper.IsTimelineFound(_newTimeline))
     {
         TimelineHelper.DeleteTimelineByJavaScript(_newTimeline);
     }
     CreateScreenshotsIfTestFail(TestContext);
 }
Пример #16
0
        public void TestInitialize()
        {
            BrowserStateManager.RefreshState();
            HomePageHelper.OpenPage();
            AuthorizationHelper.OpenLoginPage();
            AuthorizationHelper.AuthenticateAsMicrosoftUser(); //authenticate as existing cz user
            HomePageHelper.DeleteAllElementsLocally();
            var exhibit = new Exhibit {
                Title = "WebdriverExhibitWithContent"
            };

            ExhibitHelper.AddExhibitWithoutFormClosing(exhibit);
            ExhibitHelper.ClickByAddArtifact();
        }
Пример #17
0
        public void founded_bing_images_info_should_insert_correctly()
        {
            string imageUrlFromSearchResult;
            string mediaSourceFromSearchResult;

            ArtifactSearchHelper.FindAndSelectRandomImage(out imageUrlFromSearchResult, out mediaSourceFromSearchResult);

            string imageUrlFromArtifactForm    = ExhibitHelper.GetCurrentImageOrVideoUrl();
            string mediaSourceFromArtifactForm = ExhibitHelper.GetCurrentMediaSource();
            string mediaTypeFromArtifactForm   = ExhibitHelper.GetCurrentMediaType();

            Assert.AreEqual(imageUrlFromSearchResult, imageUrlFromArtifactForm);
            Assert.AreEqual(mediaSourceFromArtifactForm, mediaSourceFromSearchResult);
            Assert.AreEqual("image", mediaTypeFromArtifactForm.ToLower());
        }
Пример #18
0
        public void founded_bing_pdfs_info_should_insert_correctly()
        {
            string pdfUrlFromSearchResult;

            ArtifactSearchHelper.FindAndSelectRandomPdf(out pdfUrlFromSearchResult);

            string pdfUrlFromArtifactForm      = ExhibitHelper.GetCurrentImageOrVideoUrl();
            string attributionFromArtifactForm = ExhibitHelper.GetCurrentAttribution();
            string mediaSourceFromArtifactForm = ExhibitHelper.GetCurrentMediaSource();
            string mediaTypeFromArtifactForm   = ExhibitHelper.GetCurrentMediaType();

            Assert.AreEqual(pdfUrlFromSearchResult, pdfUrlFromArtifactForm);
            Assert.AreEqual(pdfUrlFromSearchResult, attributionFromArtifactForm);
            Assert.AreEqual(pdfUrlFromSearchResult, mediaSourceFromArtifactForm);
            Assert.AreEqual("pdf", mediaTypeFromArtifactForm.ToLower());
        }
        protected virtual void Init()
        {
            var siteConnectionString = Config.GetConnectionString(DataStore.Site);

            ExhibitId = new ExhibitTable(siteConnectionString).GetFirstActiveExhibitId();


            if (ExhibitId == 0)
            {
                const string resourceLocation = "TestAutomation.Resources.DEI_Automation.vhd";

                //create the exhibit and hand off for processing.
                var exhibitHelper = new ExhibitHelper();
                var exhibitData   = exhibitHelper.PrepareDbData(resourceLocation, AcquisitionFormatType.ForensicImage);
                exhibitHelper.ProcessExhibit(exhibitData.ExhibitId, exhibitData.MediaId, AcquisitionFormatType.ForensicImage);
                ExhibitId = exhibitData.ExhibitId;
                MediaId   = exhibitData.MediaId;

                //wait while the exhibit processes...
                //check periodically upto 10 minutes, this will need to be adjusted if we process a larger exhibit - or come up with a better approach.
                var startTime = DateTime.Now;

                try
                {
                    while (!exhibitHelper.IsExhibitProcessed(exhibitData))
                    {
                        var elapsedTime = DateTime.Now.Subtract(startTime).TotalSeconds;
                        if (elapsedTime > 600)
                        {
                            throw new Exception("Exhibit Processing Time out");
                        }
                        Thread.Sleep(500);
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Processing failed: {0}", ex.Message);
                    ExhibitSetup = false;
                    return;
                }
            }
            ExhibitConnectionString = EVE.Site.DAL.Config.GetConnectionString(DataStore.Exhibit).Replace(EVE.Site.DAL.Config.ExhibitPlaceholder, ExhibitId.ToString(CultureInfo.InvariantCulture));
            MediaId      = new MediaTable(ExhibitConnectionString).GetFirstActiveMediaId();
            ExhibitSetup = true;
        }
Пример #20
0
        public void change_of_bing_results_change_form_fields_correctly()
        {
            string imageUrlFromSearchResult;
            string imageMediaSourceFromSearchResult;

            ArtifactSearchHelper.FindAndSelectRandomImage(out imageUrlFromSearchResult, out imageMediaSourceFromSearchResult);
            string imageUrlFromArtifactForm         = ExhibitHelper.GetCurrentImageOrVideoUrl();
            string imageMediaSourceFromArtifactForm = ExhibitHelper.GetCurrentMediaSource();
            string imageMediaTypeFromArtifactForm   = ExhibitHelper.GetCurrentMediaType();

            Assert.AreEqual(imageUrlFromSearchResult, imageUrlFromArtifactForm);
            Assert.AreEqual(imageMediaSourceFromArtifactForm, imageMediaSourceFromSearchResult);
            Assert.AreEqual("image", imageMediaTypeFromArtifactForm.ToLower());

            string videoUrlFromSearchResult;

            ArtifactSearchHelper.FindAndSelectRandomVideo(out videoUrlFromSearchResult);
            string videoUrlFromArtifactForm         = ExhibitHelper.GetCurrentImageOrVideoUrl();
            string videoAttributionFromArtifactForm = ExhibitHelper.GetCurrentAttribution();
            string videoMediaSourceFromArtifactForm = ExhibitHelper.GetCurrentMediaSource();
            string videMediaTypeFromArtifactForm    = ExhibitHelper.GetCurrentMediaType();

            Assert.AreEqual(videoUrlFromSearchResult, videoUrlFromArtifactForm);
            Assert.AreEqual(videoUrlFromSearchResult, videoAttributionFromArtifactForm);
            Assert.AreEqual(videoUrlFromSearchResult, videoMediaSourceFromArtifactForm);
            Assert.AreEqual("video", videMediaTypeFromArtifactForm.ToLower());

            string pdfUrlFromSearchResult;

            ArtifactSearchHelper.FindAndSelectRandomPdf(out pdfUrlFromSearchResult);
            string pdfUrlFromArtifactForm         = ExhibitHelper.GetCurrentImageOrVideoUrl();
            string pdfAttributionFromArtifactForm = ExhibitHelper.GetCurrentAttribution();
            string pdfMediaSourceFromArtifactForm = ExhibitHelper.GetCurrentMediaSource();
            string pdfMediaTypeFromArtifactForm   = ExhibitHelper.GetCurrentMediaType();

            Assert.AreEqual(pdfUrlFromSearchResult, pdfUrlFromArtifactForm);
            Assert.AreEqual(pdfUrlFromSearchResult, pdfAttributionFromArtifactForm);
            Assert.AreEqual(pdfUrlFromSearchResult, pdfMediaSourceFromArtifactForm);
            Assert.AreEqual("pdf", pdfMediaTypeFromArtifactForm.ToLower());
        }
Пример #21
0
        public void exhibit_should_display_correct_date_december_in_bce()
        {
            var contentItemPdf = new ContentItem
            {
                Title       = RandomString.GetRandomString(1, 200),
                Caption     = RandomString.GetRandomString(1, 200),
                MediaSource = RandomUrl.GetRandomWebUrl(),
                MediaType   = "image",
                Attribution = RandomString.GetRandomString(1, 200),
                Uri         = RandomUrl.GetRandomImageUrl(),
                Order       = 0
            };
            const decimal year = -2015;

            _newExhibit = new Exhibit
            {
                Title        = RandomString.GetRandomString(1, 200),
                ContentItems = new Collection <ContentItem> {
                    contentItemPdf
                },

                Month       = "December",
                Day         = "31",
                Year        = ExhibitHelper.GetCoordinateFromYmd(year, 12, 31),
                Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314")
            };
            ApiHelper.CreateExhibitByApi(_newExhibit);
            HomePageHelper.OpenSandboxPage();
            ExhibitHelper.NavigateToExhibit(_newExhibit);
            string displayDate = ExhibitHelper.GetExhibitDisplayDate(_newExhibit);

            StringAssert.Contains(displayDate, "BCE");
            StringAssert.Contains(displayDate, year.ToString(CultureInfo.InvariantCulture));
            StringAssert.Contains(displayDate, _newExhibit.Day);
            if (GitHubIssueWatcher.IssueStatus.IsIssueResolved("1024"))
            {
                StringAssert.Contains(displayDate, DateTime.ParseExact(_newExhibit.Month, "MMMM", CultureInfo.InvariantCulture).Month.ToString(CultureInfo.InvariantCulture));
            }
        }
Пример #22
0
 public ExhibitHelper GetExhibitHelper()
 {
     return(_exhibitHelper ?? (_exhibitHelper = new ExhibitHelper()));
 }
Пример #23
0
        public void Test_Eukaryotic_Cells_Description()
        {
            string description = ExhibitHelper.GetEukaryoticCellsDescription();

            StringAssert.Contains(description, "eukaryotic cells");
        }
Пример #24
0
 public void Search_Take_Our_Survey_Artifact()
 {
     //https://github.com/alterm4nn/ChronoZoom/issues/355
     SearchHelper.Search_Take_Our_Survey_Artifact();
     StringAssert.Contains(ExhibitHelper.GetContentItemDescription(), "Your responses to these 12 questions will help us prioritize the next set");
 }
Пример #25
0
 public void Search_Take_Our_Survey_Artifact()
 {
     SearchHelper.Search_Take_Our_Survey_Artifact();
     StringAssert.Contains(ExhibitHelper.GetTakeOurSurveyArtifactContentItemDescription(), "Your responses to these 12 questions will help us prioritize the next set");
 }
Пример #26
0
        public HelperTest()
        {
            Sutr = new RoleHelper(new AquaLearnIMDbContext());
            Sutt = new TrashHelper(new AquaLearnIMDbContext());
            Sutf = new FishHelper(new AquaLearnIMDbContext());
            Sutp = new PlantHelper(new AquaLearnIMDbContext());
            Suth = new HazardHelper(new AquaLearnIMDbContext());
            Sute = new ExhibitHelper(new AquaLearnIMDbContext());
            Sutu = new UserHelper(new AquaLearnIMDbContext());
            Sutq = new QuizHelper(new AquaLearnIMDbContext());
      
            role = new Role()
            {
                Name = "Teacher"
            };

            trash = new Trash()
            {
                Name = "Plastic Bottles",
                Schooling = true,
                Description = "Americans throw away 35 billion plastic water bottles every year.Making the ocean inhabitable for sea creatures."
            };

            fish = new Fish()
            {
                Name = "Shark",
                Schooling = false,
                Description = "Sharks are the most threatening predators in the ocean.",
                WaterType = new WaterType()
                {
                    WaterTypeId = 4,
                    Name = "Ocean Salt Water"
                }
            };
      
            plant = new Plant()
            {
                Name = "Algae",
                Description = "Algae are very diverse and found almost everywhere on the planet. They play an important role in many ecosystems, including providing the foundation for the aquatic food chains supporting all fisheries in the oceans and inland, as well as producing about 70 percent of all the air we breathe."
            };

            hazard = new Hazard()
            {
                Name = "Plastic",
                Description = "Pollution"
            };

            exhibit = new Exhibit()
            {
                Name = "Deep Sea",
            };

            user = new User()
            {
                Username = "******",
                Password = "******",
                ClassroomId = 22
            };

            quiz = new Quiz()
            {
               Name="Quiz"
            };

            Sutr.SetRole(role);
            Sutt.SetTrash(trash);
        }
Пример #27
0
 public void random_new_exhibit_should_be_deleted()
 {
     ExhibitHelper.DeleteExhibit(_newExhibit);
     Assert.IsFalse(ExhibitHelper.IsExhibitFound(_newExhibit));
 }