Giter VIP home page Giter VIP logo

fetchsdet's Introduction

fetchSDET

This is the project to find the fake gold, test the UI for http://sdetchallenge.fetch.com/.

Best algorithm

The logic of find the fake gold with minimum number of weighing is:

  1. Partition the gold into three groups, each containing three gold bars.
  2. Weigh the first two groups. If one group is lighter than the other, that group contains the fake gold. Otherwise, the fake gold is in the third group.
  3. Continue to partition the group with fake gold into three groups, each containing one gold bar.
  4. Weigh the first two bars. If one bar is lighter than the other, that one is the fake gold. Otherwise, the fake gold is the third one.

Dependencies

Before you begin, make sure you have the following prerequisites installed on your system:

How to run the project

  1. Clone the project repository to your local machine using Git:

    git clone https://github.com/Jemie-Wang/fetchSDET.git
  2. Navigate to the project directory:

    cd fetchSDET
  3. Build the project using Maven

    mvn clean install

    This command will compile the source code, run the unhidden tests, and generate project artifacts.

  4. Run the code to find fake gold, which implements the best algorithm

    java -jar target/fetchSDET-1.0-SNAPSHOT.jar

    This will open the browser, fill out the bowls grids with bar numbers, click on buttons (“Weigh”, “Reset”), get the measurement results with the minimum steps, and then click on the fake gold bar number at the bottom, and log the relevant information.

    To enhance the user experience, the alert will be displayed for 4 seconds before it is automatically dismissed.

Test Components:

To enhance the readability and comprehensiveness of our test results, JUnit framework was used to introduce additional unit tests. These tests verify the UI's behavior under various scenarios to ensure its correctness. Specifically:

  • Verify that the appropriate alert is triggered when the correct or incorrect number of gold bars is selected.
  • Confirm that the bowl rejects invalid inputs, such as numbers outside the range of 0 to 8 or non-numeric inputs.
  • Check for an alert if a duplicate gold bar index is placed in a single bowl.
  • Ensure that an alert is raised if the same gold bar index is positioned on both sides of the scale.

To run the test, use command

mvn test -Dtest=ExtraTest

fetchsdet's People

Contributors

jemie-wang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.