Skip to content

Commit

Permalink
Add timezone to chrome driver for ModelDiffTest (#986)
Browse files Browse the repository at this point in the history
* Add timezone to chrome driver for ModelDiffTest

* Update explanation of ModelUniquenessCheck

* Unit test fix
  • Loading branch information
vchaitanya authored Oct 29, 2024
1 parent e8b8b77 commit e44dc9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL;
import static org.openqa.selenium.chrome.ChromeDriverService.CHROME_DRIVER_SILENT_OUTPUT_PROPERTY;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

Expand Down Expand Up @@ -167,7 +169,15 @@ public WebDriver get() {
System.setProperty( CHROME_DRIVER_SILENT_OUTPUT_PROPERTY, "true" );
Logger.getLogger( "org.openqa.selenium" ).setLevel( Level.OFF );

return new ChromeDriver( options );
ChromeDriver driver = new ChromeDriver( options );

// Test expectations assume UTC
Map<String, Object> params = new HashMap<>();
params.put( "timezoneId", "UTC" );

driver.executeCdpCommand( "Emulation.setTimezoneOverride", params );

return driver;
}
},
FIREFOX {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String name() {

@Override
public String explanation() {
return "Models should be uniquely identified by its title";
return "Models should be uniquely identified by their title";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ModelUniquenessCheckTest extends AbstractValidationTest {

ModelUniquenessCheckTest() {
super( new ModelUniquenessCheck(), "Model uniqueness",
"Models should be uniquely identified by its title" );
"Models should be uniquely identified by their title" );
}

private List<Model> createMockModels( List<String> titles ) {
Expand Down

0 comments on commit e44dc9a

Please sign in to comment.