header.navigation

    SOFTWARE TESTING

    • register
    • login
    • search
    • Job Openings
    • Freelance Jobs
    • Services
    • Conferences
    • Courses
    1. home
    2. elysha
    E
    • profile
    • following
    • followers
    • topics
    • posts
    • best
    • header.groups

    elysha

    @elysha

    0
    reputation
    8
    posts
    1
    profile_views
    0
    followers
    0
    following
    joined lastonline

    elysha follow

    pages:account/best, elysha

    has_no_posts

    pages:account/latest-posts, elysha

    • C# Selenium Chrome Add URLs to Insecure Content

      I need to add a site URL to the list of allowable sites for insecure content. I cannot for the life of me find anything on the subject. I was able to do something similar for adding a URL list to allow flash but can't get the Chrome specific settings syntax to work for the insecure content tab. This is the code I used to get the URL list to the allowable flash settings:

      var service = ChromeDriverService.CreateDefaultService(seleniumLocation);
      var options = new ChromeOptions();
      List<string> flashUrls = new List<string>() { 
             "https://www.someplace.com","https://www.someotherplace.com" };
      options.AddUserProfilePreference("profile.managed_plugins_allowed_for_urls", flashUrls);
      IWebDriver driver = new ChromeDriver(service, options);
      

      That works perfectly fine. I've tried different variations of this for Insecure Content but none are able to add the URL.

      List<string> insecureUrls = new List<string>() { 
           "https://www.someplace.com","https://www.someotherplace.com" };
      options.AddUserProfilePreference("profile.insecure_content_allowed_for_urls", insecureUrls);
      

      I'm pretty certain what's wrong is the profile.insecure_content_allowed_for_urls portion but can't find any info anywhere about what it should actually be. Below is a screenshot of the setting in Chrome.

      global:posted_in, Automated Testing
      E
      elysha
    • RE: How to remove skipped tests from html report (Pytest)

      By using this, i can ignore skipped tests in html report

      def pytest_html_results_table_row(report, cells):
          if report.skipped:
            del cells[:]
      
      global:posted_in, Automated Testing
      E
      elysha
    • RE: How to check the hash value in the database in Laravel tests?

      Thanks! I thought of doing the same a few minutes before your answer πŸ˜‚ I just assumed that perhaps Laravel has some standard solution in the form of a method like assertHash or something like that ... As a result, I extended the TestCase class and added the required method with this functionality.

      global:posted_in, Automated Testing
      E
      elysha
    • How to check the hash value in the database in Laravel tests?

      I need to check the hash of the user's password in the database in the test.

      Laravel has a seeInDatabase method, it checks if a record exists in a table using an array of key-values. With its help, it is impossible to check the field with a hashed value, because the bcrypt function returns different values ​​each time.

      Test code:

      public function testResetFinancePasswordAPI ()
      {
          / ** @var array $ users * /
          $ users = $ this-> seedUsers ();
      
          foreach ($ users as $ user) {
              / ** @var \ App \ Models \ User $ user * /
      
              $ this-> be ($ user);
      
              $ request = [
                  'current_finance_password' => $ this-> financePassword,
                  'new_finance_password' => $ this-> newFinancePassword,
              ];
      
              $ this-> post ('/ lk / settings / reset_finance_password', $ request);
      
              $ this-> assertResponseOk ();
              $ this-> seeJson ();
              $ this-> seeInDatabase ('users', [
                  'id' => $ user-> id,
                  'finance_password' => bcrypt ($ this-> newFinancePassword),
              ]);
          }
      }
      

      P.S. Laravel version is 5.3

      global:posted_in, Automated Testing
      E
      elysha
    • How to send json to client for verification?

      I want to send a json file to the client (from the client) - to test the function. How best to implement this? I raised a separate container with a unit test for a similar task on the back-end. What to do at the front is not very obvious

      global:posted_in, API Testing
      E
      elysha
    • How to test Optional.orElseThrow() (Java)?

      I have a method using a repository using Optional.orElseThrow inside a service.

      How to correctly implement the construction

      when(restLogRepository.findById(anyLong()).thenReturn(log);
      

      My way is obviously wrong

      Service

      public RestLogDto readById(Long id) {
          return DtoConverter.convert(
              restLogRepository.findById(id).orElseThrow(() -> new NoSuchElementException("Element not found")),
              modelMapper);
          }
      

      My Test method (wrong)

      @Test
      public void readById() {
          RestLog log = new RestLog();
          log.setLogId(LOG_ID);
      
          when(restLogRepository.findById(anyLong()).orElseThrow(any(Supplier.class))).thenReturn(log);
          RestLogDto result = DtoConverter.convert(log, mapper);
      
          assertEquals(result, logReader.readById(LOG_ID));
      }
      
      global:posted_in, Automated Testing
      E
      elysha
    • RE: Have you ever used a White box testing for your job?

      Yes that's good practice. But you need to know programming to do white box testing

      global:posted_in, Manual Testing
      E
      elysha
    • RE: Learning something new about software testing?

      I always read something about software testing once a week on the weekend πŸ™‚

      global:posted_in, General Discussion
      E
      elysha